home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / galaxian.c < prev    next >
C/C++ Source or Header  |  2000-05-22  |  127KB  |  3,173 lines

  1. /***************************************************************************
  2.  
  3. Galaxian/Moon Cresta memory map.
  4.  
  5. Compiled from information provided by friends and Uncles on RGVAC.
  6.  
  7. Add 0x4000 to all addresses except for the ROM for Moon Cresta.
  8.  
  9.             AAAAAA
  10.             111111AAAAAAAAAA     DDDDDDDD   Schem   function
  11. HEX         5432109876543210 R/W 76543210   name
  12.  
  13. 0000-3FFF                                           Game ROM
  14. 4000-47FF                                            Working ram
  15. 5000-57FF   01010AAAAAAAAAAA R/W DDDDDDDD   !Vram   Character ram
  16. 5800-583F   01011AAAAAAAAAAA R/W DDDDDDDD   !OBJRAM Screen attributes
  17. 5840-585F   01011AAAAAAAAAAA R/W DDDDDDDD   !OBJRAM Sprites
  18. 5860-5FFF   01011AAAAAAAAAAA R/W DDDDDDDD   !OBJRAM Bullets
  19.  
  20. 6000        0110000000000000 R   -------D   !SW0    coin1
  21. 6000        0110000000000000 R   ------D-   !SW0    coin2
  22. 6000        0110000000000000 R   -----D--   !SW0    p1 left
  23. 6000        0110000000000000 R   ----D---   !SW0    p1 right
  24. 6000        0110000000000000 R   ---D----   !SW0    p1shoot
  25. 6000        0110000000000000 R   --D-----   !SW0    table ??
  26. 6000        0110000000000000 R   -D------   !SW0    test
  27. 6000        0110000000000000 R   D-------   !SW0    service
  28.  
  29. 6000        0110000000000001 W   -------D   !DRIVER lamp 1 ??
  30. 6001        0110000000000001 W   -------D   !DRIVER lamp 2 ??
  31. 6002        0110000000000010 W   -------D   !DRIVER lamp 3 ??
  32. 6003        0110000000000011 W   -------D   !DRIVER coin control
  33. 6004        0110000000000100 W   -------D   !DRIVER Background lfo freq bit0
  34. 6005        0110000000000101 W   -------D   !DRIVER Background lfo freq bit1
  35. 6006        0110000000000110 W   -------D   !DRIVER Background lfo freq bit2
  36. 6007        0110000000000111 W   -------D   !DRIVER Background lfo freq bit3
  37.  
  38. 6800        0110100000000000 R   -------D   !SW1    1p start
  39. 6800        0110100000000000 R   ------D-   !SW1    2p start
  40. 6800        0110100000000000 R   -----D--   !SW1    p2 left
  41. 6800        0110100000000000 R   ----D---   !SW1    p2 right
  42. 6800        0110100000000000 R   ---D----   !SW1    p2 shoot
  43. 6800        0110100000000000 R   --D-----   !SW1    no used
  44. 6800        0110100000000000 R   -D------   !SW1    dip sw1
  45. 6800        0110100000000000 R   D-------   !SW1    dip sw2
  46.  
  47. 6800        0110100000000000 W   -------D   !SOUND  reset background F1
  48.                                                     (1=reset ?)
  49. 6801        0110100000000001 W   -------D   !SOUND  reset background F2
  50. 6802        0110100000000010 W   -------D   !SOUND  reset background F3
  51. 6803        0110100000000011 W   -------D   !SOUND  Noise on/off
  52. 6804        0110100000000100 W   -------D   !SOUND  not used
  53. 6805        0110100000000101 W   -------D   !SOUND  shoot on/off
  54. 6806        0110100000000110 W   -------D   !SOUND  Vol of f1
  55. 6807        0110100000000111 W   -------D   !SOUND  Vol of f2
  56.  
  57. 7000        0111000000000000 R   -------D   !DIPSW  dip sw 3
  58. 7000        0111000000000000 R   ------D-   !DIPSW  dip sw 4
  59. 7000        0111000000000000 R   -----D--   !DIPSW  dip sw 5
  60. 7000        0111000000000000 R   ----D---   !DIPSW  dip s2 6
  61.  
  62. 7001/B000/1 0111000000000001 W   -------D   9Nregen NMIon
  63. 7004        0111000000000100 W   -------D   9Nregen stars on
  64. 7006        0111000000000110 W   -------D   9Nregen hflip
  65. 7007        0111000000000111 W   -------D   9Nregen vflip
  66.  
  67. Note: 9n reg,other bits  used on moon cresta for extra graphics rom control.
  68.  
  69. 7800        0111100000000000 R   --------   !wdr    watchdog reset
  70. 7800        0111100000000000 W   DDDDDDDD   !pitch  Sound Fx base frequency
  71.  
  72.  
  73. Notes:
  74. -----
  75.  
  76. - The only code difference between 'galaxian' and 'galmidw' is that the
  77.   'BONUS SHIP' text is printed on a different line.
  78.  
  79. Main clock: XTAL = 18.432 MHz
  80. Z80 Clock: XTAL/6 = 3.072 MHz
  81. Horizontal video frequency: HSYNC = XTAL/3/192/2 = 16 kHz
  82. Video frequency: VSYNC = HSYNC/132/2 = 60.606060 Hz
  83. VBlank duration: 1/VSYNC * (20/132) = 2500 us
  84.  
  85. Changes:
  86. 19 Feb 98 LBO
  87.     * Added Checkman driver
  88. 19 Jul 98 LBO
  89.     * Added King & Balloon driver
  90.  
  91. TODO:
  92.     * Need valid color prom for Fantazia. Current one is slightly damaged.
  93.  
  94.  
  95. Jump Bug memory map (preliminary)
  96.  
  97. 0000-3fff ROM
  98. 4000-47ff RAM
  99. 4800-4bff Video RAM
  100. 4c00-4fff mirror address for video RAM
  101. 5000-50ff Object RAM
  102.   5000-503f  screen attributes
  103.   5040-505f  sprites
  104.   5060-507f  bullets?
  105.   5080-50ff  unused?
  106. 8000-a7ff ROM
  107.  
  108. read:
  109. 6000      IN0
  110. 6800      IN1
  111. 7000      IN2
  112.  
  113. write:
  114. 5800      8910 write port
  115. 5900      8910 control port
  116. 6002-6006 gfx bank select - see vidhrdw/jumpbug.c for details
  117. 7001      interrupt enable
  118. 7002      coin counter ????
  119. 7003      ?
  120. 7004      stars on
  121. 7005      ?
  122. 7006      screen vertical flip
  123. 7007      screen horizontal flip
  124. 7800      ?
  125.  
  126.  
  127. Moon Cresta versions supported:
  128. ------------------------------
  129.  
  130. mooncrst    Nichibutsu - later revision with better demo mode and
  131.                          text for docking. Encrypted. No ROM/RAM check
  132. mooncrs2    Nichibutsu - probably first revision (no patches) and ROM/RAM check code.
  133.                          This came from a bootleg board, with the logos erased
  134.                          from the graphics
  135. mooncrsg    Gremlin    - same docking text as mooncrst
  136. mooncrsb    bootleg of mooncrs2. ROM/RAM check erased.
  137.  
  138.  
  139.  
  140. ***************************************************************************/
  141.  
  142. #include "driver.h"
  143. #include "vidhrdw/generic.h"
  144. #include "cpu/z80/z80.h"
  145.  
  146.  
  147. extern unsigned char *galaxian_attributesram;
  148. extern unsigned char *galaxian_bulletsram;
  149. extern size_t galaxian_bulletsram_size;
  150. void galaxian_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  151. WRITE_HANDLER( galaxian_flipx_w );
  152. WRITE_HANDLER( galaxian_flipy_w );
  153. WRITE_HANDLER( galaxian_attributes_w );
  154. WRITE_HANDLER( galaxian_stars_w );
  155. WRITE_HANDLER( scramble_background_w );
  156. WRITE_HANDLER( mooncrst_gfxextend_w );
  157. int  galaxian_vh_start(void);
  158. int  mooncrst_vh_start(void);
  159. int   moonqsr_vh_start(void);
  160. int  mooncrgx_vh_start(void);
  161. int    pisces_vh_start(void);
  162. int  scramble_vh_start(void);
  163. int   jumpbug_vh_start(void);
  164. int    zigzag_vh_start(void);
  165. void galaxian_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  166. int  galaxian_vh_interrupt(void);
  167. int  scramble_vh_interrupt(void);
  168. int  devilfsg_vh_interrupt(void);
  169. int   jumpbug_vh_interrupt(void);
  170. WRITE_HANDLER( jumpbug_gfxbank_w );
  171. WRITE_HANDLER( pisces_gfxbank_w );
  172.  
  173. WRITE_HANDLER( galaxian_pitch_w );
  174. WRITE_HANDLER( galaxian_vol_w );
  175. WRITE_HANDLER( galaxian_noise_enable_w );
  176. WRITE_HANDLER( galaxian_background_enable_w );
  177. WRITE_HANDLER( galaxian_shoot_enable_w );
  178. WRITE_HANDLER( galaxian_lfo_freq_w );
  179. int  galaxian_sh_start(const struct MachineSound *msound);
  180. void galaxian_sh_stop(void);
  181. void galaxian_sh_update(void);
  182.  
  183. READ_HANDLER( scramblb_protection_1_r );
  184. READ_HANDLER( scramblb_protection_2_r );
  185.  
  186.  
  187. static WRITE_HANDLER( galaxian_coin_lockout_w )
  188. {
  189.     coin_lockout_global_w(offset, data ^ 1);
  190. }
  191.  
  192. static WRITE_HANDLER( galaxian_leds_w )
  193. {
  194.     osd_led_w(offset,data);
  195. }
  196.  
  197. static READ_HANDLER( galapx_funky_r )
  198. {
  199.     return 0xff;
  200. }
  201.  
  202.  
  203. /* Send sound data to the sound cpu and cause an nmi */
  204. static int kingball_speech_dip;
  205.  
  206. /* Hack? If $b003 is high, we'll check our "fake" speech dipswitch */
  207. static READ_HANDLER( kingball_IN0_r )
  208. {
  209.     if (kingball_speech_dip)
  210.         return (readinputport (0) & 0x80) >> 1;
  211.     else
  212.         return readinputport (0);
  213. }
  214.  
  215. static WRITE_HANDLER( kingball_speech_dip_w )
  216. {
  217.     kingball_speech_dip = data;
  218. }
  219.  
  220. static int kingball_sound;
  221.  
  222. static WRITE_HANDLER( kingball_sound1_w )
  223. {
  224.     kingball_sound = (kingball_sound & ~0x01) | data;
  225.     logerror("kingball_sample latch: %02x (%02x)\n", kingball_sound, data);
  226. }
  227.  
  228. static WRITE_HANDLER( kingball_sound2_w )
  229. {
  230.     kingball_sound = (kingball_sound & ~0x02) | (data << 1);
  231.     soundlatch_w (0, kingball_sound | 0xf0);
  232.     logerror("kingball_sample play: %02x (%02x)\n", kingball_sound, data);
  233. }
  234.  
  235.  
  236. static void machine_init_galaxian(void)
  237. {
  238.     install_mem_write_handler(0, 0x6002, 0x6002, galaxian_coin_lockout_w);
  239. }
  240.  
  241. static void machine_init_galapx(void)
  242. {
  243.     /* for the title screen */
  244.     install_mem_read_handler(0, 0x7800, 0x78ff, galapx_funky_r);
  245.     machine_init_galaxian();
  246. }
  247.  
  248. static void machine_init_kingball(void)
  249. {
  250.     install_mem_read_handler(0, 0xa000, 0xa000, kingball_IN0_r);
  251. }
  252.  
  253.  
  254. static READ_HANDLER( jumpbug_protection_r )
  255. {
  256.     switch (offset)
  257.     {
  258.     case 0x0114:  return 0x4f;
  259.     case 0x0118:  return 0xd3;
  260.     case 0x0214:  return 0xcf;
  261.     case 0x0235:  return 0x02;
  262.     case 0x0311:  return 0x00;  /* not checked */
  263.     default:
  264.         logerror("Unknown protection read. Offset: %04X  PC=%04X\n",0xb000+offset,cpu_get_pc());
  265.     }
  266.  
  267.     return 0;
  268. }
  269.  
  270. static READ_HANDLER( checkmaj_protection_r )
  271. {
  272.     switch (cpu_get_pc())
  273.     {
  274.     case 0x0f15:  return 0xf5;
  275.     case 0x0f8f:  return 0x7c;
  276.     case 0x10b3:  return 0x7c;
  277.     case 0x10e0:  return 0x00;
  278.     case 0x10f1:  return 0xaa;
  279.     case 0x1402:  return 0xaa;
  280.     default:
  281.         logerror("Unknown protection read. PC=%04X\n",cpu_get_pc());
  282.     }
  283.  
  284.     return 0;
  285. }
  286.  
  287. /* Send sound data to the sound cpu and cause an nmi */
  288. static WRITE_HANDLER( checkman_sound_command_w )
  289. {
  290.     soundlatch_w (0,data);
  291.     cpu_cause_interrupt (1, Z80_NMI_INT);
  292. }
  293.  
  294. static struct MemoryReadAddress galaxian_readmem[] =
  295. {
  296.     { 0x0000, 0x3fff, MRA_ROM },    /* not all games use all the space */
  297.     { 0x4000, 0x47ff, MRA_RAM },
  298.     { 0x5000, 0x53ff, MRA_RAM },    /* video RAM */
  299.     { 0x5400, 0x57ff, videoram_r },    /* video RAM mirror */
  300.     { 0x5800, 0x5fff, MRA_RAM },    /* screen attributes, sprites, bullets */
  301.     { 0x6000, 0x6000, input_port_0_r },    /* IN0 */
  302.     { 0x6800, 0x6800, input_port_1_r },    /* IN1 */
  303.     { 0x7000, 0x7000, input_port_2_r },    /* DSW */
  304.     { 0x7800, 0x7800, watchdog_reset_r },
  305.     { -1 }    /* end of table */
  306. };
  307.  
  308. static struct MemoryWriteAddress galaxian_writemem[] =
  309. {
  310.     { 0x0000, 0x3fff, MWA_ROM },    /* not all games use all the space */
  311.     { 0x4000, 0x47ff, MWA_RAM },
  312.     { 0x5000, 0x53ff, videoram_w, &videoram, &videoram_size },
  313.     { 0x5800, 0x583f, galaxian_attributes_w, &galaxian_attributesram },
  314.     { 0x5840, 0x585f, MWA_RAM, &spriteram, &spriteram_size },
  315.     { 0x5860, 0x587f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  316.     { 0x5880, 0x58ff, MWA_RAM },
  317.     { 0x6000, 0x6001, galaxian_leds_w },
  318.     { 0x6004, 0x6007, galaxian_lfo_freq_w },
  319.     { 0x6800, 0x6802, galaxian_background_enable_w },
  320.     { 0x6803, 0x6803, galaxian_noise_enable_w },
  321.     { 0x6805, 0x6805, galaxian_shoot_enable_w },
  322.     { 0x6806, 0x6807, galaxian_vol_w },
  323.     { 0x7001, 0x7001, interrupt_enable_w },
  324.     { 0x7004, 0x7004, galaxian_stars_w },
  325.     { 0x7006, 0x7006, galaxian_flipx_w },
  326.     { 0x7007, 0x7007, galaxian_flipy_w },
  327.     { 0x7800, 0x7800, galaxian_pitch_w },
  328.     { -1 }    /* end of table */
  329. };
  330.  
  331.  
  332. static struct MemoryReadAddress mooncrst_readmem[] =
  333. {
  334.     { 0x0000, 0x3fff, MRA_ROM },
  335.     { 0x8000, 0x83ff, MRA_RAM },
  336.     { 0x9000, 0x93ff, MRA_RAM },    /* video RAM */
  337.     { 0x9400, 0x97ff, videoram_r },    /* Checkman - video RAM mirror */
  338.     { 0x9800, 0x9fff, MRA_RAM },    /* screen attributes, sprites, bullets */
  339.     { 0xa000, 0xa000, input_port_0_r },    /* IN0 */
  340.     { 0xa800, 0xa800, input_port_1_r },    /* IN1 */
  341.     { 0xb000, 0xb000, input_port_2_r },    /* DSW (coins per play) */
  342.     { 0xb800, 0xb800, watchdog_reset_r },
  343.     { -1 }    /* end of table */
  344. };
  345.  
  346. static struct MemoryWriteAddress mooncrst_writemem[] =
  347. {
  348.     { 0x0000, 0x3fff, MWA_ROM },
  349.     { 0x8000, 0x83ff, MWA_RAM },
  350.     { 0x9000, 0x93ff, videoram_w, &videoram, &videoram_size },
  351.     { 0x9800, 0x983f, galaxian_attributes_w, &galaxian_attributesram },
  352.     { 0x9840, 0x985f, MWA_RAM, &spriteram, &spriteram_size },
  353.     { 0x9860, 0x987f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  354.     { 0x9880, 0x98ff, MWA_RAM },
  355.     { 0xa000, 0xa002, mooncrst_gfxextend_w },    /* Moon Cresta only */
  356.     { 0xa004, 0xa007, galaxian_lfo_freq_w },
  357.     { 0xa800, 0xa802, galaxian_background_enable_w },
  358.     { 0xa803, 0xa803, galaxian_noise_enable_w },
  359.     { 0xa805, 0xa805, galaxian_shoot_enable_w },
  360.     { 0xa806, 0xa807, galaxian_vol_w },
  361.     { 0xb000, 0xb000, interrupt_enable_w },    /* not Checkman */
  362.     { 0xb001, 0xb001, interrupt_enable_w },    /* Checkman only */
  363.     { 0xb004, 0xb004, galaxian_stars_w },
  364.     { 0xb006, 0xb006, galaxian_flipx_w },
  365.     { 0xb007, 0xb007, galaxian_flipy_w },
  366.     { 0xb800, 0xb800, galaxian_pitch_w },
  367.     { -1 }    /* end of table */
  368. };
  369.  
  370.  
  371. static struct MemoryReadAddress scramblb_readmem[] =
  372. {
  373.     { 0x0000, 0x3fff, MRA_ROM },
  374.     { 0x4000, 0x4bff, MRA_RAM },    /* RAM and video RAM */
  375.     { 0x5000, 0x507f, MRA_RAM },    /* screen attributes, sprites, bullets */
  376.     { 0x6000, 0x6000, input_port_0_r },    /* IN0 */
  377.     { 0x6800, 0x6800, input_port_1_r },    /* IN1 */
  378.     { 0x7000, 0x7000, input_port_2_r },    /* IN2 */
  379.     { 0x7800, 0x7800, watchdog_reset_r },
  380.     { 0x8102, 0x8102, scramblb_protection_1_r },
  381.     { 0x8202, 0x8202, scramblb_protection_2_r },
  382.     { -1 }    /* end of table */
  383. };
  384.  
  385. static struct MemoryWriteAddress scramblb_writemem[] =
  386. {
  387.     { 0x0000, 0x3fff, MWA_ROM },
  388.     { 0x4000, 0x47ff, MWA_RAM },
  389.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  390.     { 0x5000, 0x503f, galaxian_attributes_w, &galaxian_attributesram },
  391.     { 0x5040, 0x505f, MWA_RAM, &spriteram, &spriteram_size },
  392.     { 0x5060, 0x507f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  393.     { 0x5080, 0x50ff, MWA_RAM },
  394.     { 0x6000, 0x6001, MWA_NOP },  /* sound triggers */
  395.     { 0x6004, 0x6007, galaxian_lfo_freq_w },
  396.     { 0x6800, 0x6802, galaxian_background_enable_w },
  397.     { 0x6803, 0x6803, galaxian_noise_enable_w },
  398.     { 0x6805, 0x6805, galaxian_shoot_enable_w },
  399.     { 0x6806, 0x6807, galaxian_vol_w },
  400.     { 0x7001, 0x7001, interrupt_enable_w },
  401.     { 0x7002, 0x7002, coin_counter_w },
  402.     { 0x7003, 0x7003, scramble_background_w },
  403.     { 0x7004, 0x7004, galaxian_stars_w },
  404.     { 0x7006, 0x7006, galaxian_flipx_w },
  405.     { 0x7007, 0x7007, galaxian_flipy_w },
  406.     { 0x7800, 0x7800, galaxian_pitch_w },
  407.     { -1 }    /* end of table */
  408. };
  409.  
  410.  
  411. static struct MemoryReadAddress jumpbug_readmem[] =
  412. {
  413.     { 0x0000, 0x3fff, MRA_ROM },
  414.     { 0x4000, 0x4bff, MRA_RAM },    /* RAM, Video RAM */
  415.     { 0x4c00, 0x4fff, videoram_r },    /* mirror address for Video RAM*/
  416.     { 0x5000, 0x507f, MRA_RAM },    /* screen attributes, sprites */
  417.     { 0x6000, 0x6000, input_port_0_r },    /* IN0 */
  418.     { 0x6800, 0x6800, input_port_1_r },    /* IN1 */
  419.     { 0x7000, 0x7000, input_port_2_r },    /* DSW0 */
  420.     { 0x8000, 0xafff, MRA_ROM },
  421.     { 0xb000, 0xbfff, jumpbug_protection_r },
  422.     { 0xfff0, 0xffff, MRA_RAM },
  423.     { -1 }    /* end of table */
  424. };
  425.  
  426. static struct MemoryWriteAddress jumpbug_writemem[] =
  427. {
  428.     { 0x0000, 0x3fff, MWA_ROM },
  429.     { 0x4000, 0x47ff, MWA_RAM },
  430.     { 0x4800, 0x4bff, videoram_w, &videoram, &videoram_size },
  431.     { 0x4c00, 0x4fff, videoram_w },    /* mirror address for Video RAM */
  432.     { 0x5000, 0x503f, galaxian_attributes_w, &galaxian_attributesram },
  433.     { 0x5040, 0x505f, MWA_RAM, &spriteram, &spriteram_size },
  434.     { 0x5060, 0x507f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  435.     { 0x5080, 0x50ff, MWA_RAM },
  436.     { 0x5800, 0x5800, AY8910_write_port_0_w },
  437.     { 0x5900, 0x5900, AY8910_control_port_0_w },
  438.     { 0x6002, 0x6006, jumpbug_gfxbank_w },
  439.     { 0x7001, 0x7001, interrupt_enable_w },
  440.     { 0x7002, 0x7002, coin_counter_w },
  441.     { 0x7004, 0x7004, galaxian_stars_w },
  442.     { 0x7006, 0x7006, galaxian_flipx_w },
  443.     { 0x7007, 0x7007, galaxian_flipy_w },
  444.     { 0x8000, 0xafff, MWA_ROM },
  445.     { 0xfff0, 0xffff, MWA_RAM },
  446.     { -1 }    /* end of table */
  447. };
  448.  
  449. static struct MemoryWriteAddress checkmaj_writemem[] =
  450. {
  451.     { 0x0000, 0x3fff, MWA_ROM },    /* not all games use all the space */
  452.     { 0x4000, 0x47ff, MWA_RAM },
  453.     { 0x5000, 0x53ff, videoram_w, &videoram, &videoram_size },
  454.     { 0x5800, 0x583f, galaxian_attributes_w, &galaxian_attributesram },
  455.     { 0x5840, 0x585f, MWA_RAM, &spriteram, &spriteram_size },
  456.     { 0x5860, 0x587f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  457.     { 0x5880, 0x58ff, MWA_RAM },
  458.     { 0x7001, 0x7001, interrupt_enable_w },
  459.     { 0x7006, 0x7006, galaxian_flipx_w },
  460.     { 0x7007, 0x7007, galaxian_flipy_w },
  461.     { 0x7800, 0x7800, checkman_sound_command_w },
  462.     { -1 }    /* end of table */
  463. };
  464.  
  465. static struct IOWritePort checkman_writeport[] =
  466. {
  467.     { 0, 0, checkman_sound_command_w },
  468.     { -1 }    /* end of table */
  469. };
  470.  
  471. static struct MemoryReadAddress checkman_sound_readmem[] =
  472. {
  473.     { 0x0000, 0x0fff, MRA_ROM },
  474.     { 0x2000, 0x23ff, MRA_RAM },
  475.     { -1 }    /* end of table */
  476. };
  477.  
  478. static struct MemoryWriteAddress checkman_sound_writemem[] =
  479. {
  480.     { 0x0000, 0x0fff, MWA_ROM },
  481.     { 0x2000, 0x23ff, MWA_RAM },
  482.     { -1 }    /* end of table */
  483. };
  484.  
  485. static struct IOReadPort checkman_sound_readport[] =
  486. {
  487.     { 0x03, 0x03, soundlatch_r },
  488.     { 0x06, 0x06, AY8910_read_port_0_r },
  489.     { -1 }    /* end of table */
  490. };
  491.  
  492. static struct IOWritePort checkman_sound_writeport[] =
  493. {
  494.     { 0x04, 0x04, AY8910_control_port_0_w },
  495.     { 0x05, 0x05, AY8910_write_port_0_w },
  496.     { -1 }    /* end of table */
  497. };
  498.  
  499. static struct MemoryReadAddress checkmaj_sound_readmem[] =
  500. {
  501.     { 0x0000, 0x0fff, MRA_ROM },
  502.     { 0x8000, 0x81ff, MRA_RAM },
  503.     { 0xa002, 0xa002, AY8910_read_port_0_r },
  504.     { -1 }    /* end of table */
  505. };
  506.  
  507. static struct MemoryWriteAddress checkmaj_sound_writemem[] =
  508. {
  509.     { 0x0000, 0x0fff, MWA_ROM },
  510.     { 0x8000, 0x81ff, MWA_RAM },
  511.     { 0xa000, 0xa000, AY8910_control_port_0_w },
  512.     { 0xa001, 0xa001, AY8910_write_port_0_w },
  513.     { -1 }    /* end of table */
  514. };
  515.  
  516.  
  517. static struct MemoryWriteAddress kingball_writemem[] =
  518. {
  519.     { 0x0000, 0x2fff, MWA_ROM },
  520.     { 0x8000, 0x83ff, MWA_RAM },
  521.     { 0x9000, 0x93ff, videoram_w, &videoram, &videoram_size },
  522.     { 0x9800, 0x983f, galaxian_attributes_w, &galaxian_attributesram },
  523.     { 0x9840, 0x985f, MWA_RAM, &spriteram, &spriteram_size },
  524.     { 0x9860, 0x987f, MWA_RAM, &galaxian_bulletsram, &galaxian_bulletsram_size },
  525.     { 0x9880, 0x98ff, MWA_RAM },
  526.     { 0xa000, 0xa003, MWA_NOP }, /* lamps */
  527.     { 0xa004, 0xa007, galaxian_lfo_freq_w },
  528.     { 0xa800, 0xa802, galaxian_background_enable_w },
  529.     { 0xa803, 0xa803, galaxian_noise_enable_w }, //
  530.     { 0xa805, 0xa805, galaxian_shoot_enable_w }, //
  531.     { 0xa806, 0xa807, galaxian_vol_w }, //
  532.     { 0xb000, 0xb000, kingball_sound1_w },
  533.     { 0xb001, 0xb001, interrupt_enable_w },
  534.     { 0xb002, 0xb002, kingball_sound2_w },
  535.     { 0xb003, 0xb003, kingball_speech_dip_w },
  536. //    { 0xb004, 0xb004, galaxian_stars_w },
  537.     { 0xb006, 0xb006, galaxian_flipx_w },
  538.     { 0xb007, 0xb007, galaxian_flipy_w },
  539.     { 0xb800, 0xb800, galaxian_pitch_w },
  540.     { -1 }    /* end of table */
  541. };
  542.  
  543. static struct MemoryReadAddress kingball_sound_readmem[] =
  544. {
  545.     { 0x0000, 0x1fff, MRA_ROM },
  546.     { -1 }    /* end of table */
  547. };
  548.  
  549. static struct MemoryWriteAddress kingball_sound_writemem[] =
  550. {
  551.     { 0x0000, 0x1fff, MWA_ROM },
  552.     { -1 }    /* end of table */
  553. };
  554.  
  555. static struct IOReadPort kingball_sound_readport[] =
  556. {
  557.     { 0x00, 0x00, soundlatch_r },
  558.     { -1 }    /* end of table */
  559. };
  560.  
  561. static struct IOWritePort kingball_sound_writeport[] =
  562. {
  563.     { 0x00, 0x00, DAC_0_data_w },
  564.     { -1 }    /* end of table */
  565. };
  566.  
  567.  
  568. /* Zig Zag can swap ROMs 2 and 3 as a form of copy protection */
  569. static WRITE_HANDLER( zigzag_sillyprotection_w )
  570. {
  571.     unsigned char *RAM = memory_region(REGION_CPU1);
  572.  
  573.  
  574.     if (data)
  575.     {
  576.         /* swap ROM 2 and 3! */
  577.         cpu_setbank(1,&RAM[0x3000]);
  578.         cpu_setbank(2,&RAM[0x2000]);
  579.     }
  580.     else
  581.     {
  582.         cpu_setbank(1,&RAM[0x2000]);
  583.         cpu_setbank(2,&RAM[0x3000]);
  584.     }
  585. }
  586.  
  587.  
  588. /* but the way the 8910 is hooked up is even sillier! */
  589. static int latch;
  590.  
  591. static WRITE_HANDLER( zigzag_8910_latch_w )
  592. {
  593.     latch = offset;
  594. }
  595.  
  596. static WRITE_HANDLER( zigzag_8910_data_trigger_w )
  597. {
  598.     AY8910_write_port_0_w(0,latch);
  599. }
  600.  
  601. static WRITE_HANDLER( zigzag_8910_control_trigger_w )
  602. {
  603.     AY8910_control_port_0_w(0,latch);
  604. }
  605.  
  606. static struct MemoryReadAddress zigzag_readmem[] =
  607. {
  608.     { 0x0000, 0x1fff, MRA_ROM },
  609.     { 0x2000, 0x2fff, MRA_BANK1 },
  610.     { 0x3000, 0x3fff, MRA_BANK2 },
  611.     { 0x4000, 0x47ff, MRA_RAM },
  612.     { 0x5000, 0x5fff, MRA_RAM },    /* video RAM, screen attributes, sprites, bullets */
  613.     { 0x6000, 0x6000, input_port_0_r },    /* IN0 */
  614.     { 0x6800, 0x6800, input_port_1_r },    /* IN1 */
  615.     { 0x7000, 0x7000, input_port_2_r },    /* DSW */
  616.     { 0x7800, 0x7800, watchdog_reset_r },
  617.     { -1 }    /* end of table */
  618. };
  619.  
  620. static struct MemoryWriteAddress zigzag_writemem[] =
  621. {
  622.     { 0x0000, 0x3fff, MWA_ROM },
  623.     { 0x4000, 0x47ff, MWA_RAM },
  624.     { 0x4800, 0x4800, MWA_NOP },    /* part of the 8910 interface */
  625.     { 0x4801, 0x4801, zigzag_8910_data_trigger_w },
  626.     { 0x4803, 0x4803, zigzag_8910_control_trigger_w },
  627.     { 0x4900, 0x49ff, zigzag_8910_latch_w },
  628.     { 0x4a00, 0x4a00, MWA_NOP },    /* part of the 8910 interface */
  629.     { 0x5000, 0x53ff, videoram_w, &videoram, &videoram_size },
  630.     { 0x5800, 0x583f, galaxian_attributes_w, &galaxian_attributesram },
  631.     { 0x5840, 0x587f, MWA_RAM, &spriteram, &spriteram_size },    /* no bulletsram, all sprites */
  632.     { 0x7001, 0x7001, interrupt_enable_w },
  633.     { 0x7002, 0x7002, zigzag_sillyprotection_w },
  634.     { 0x7006, 0x7006, galaxian_flipx_w },
  635.     { 0x7007, 0x7007, galaxian_flipy_w },
  636.     { -1 }    /* end of table */
  637. };
  638.  
  639.  
  640.  
  641. INPUT_PORTS_START( galaxian )
  642.     PORT_START      /* IN0 */
  643.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  644.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  645.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  646.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  647.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  648.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  649.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  650.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  651.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  652.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  653.  
  654.     PORT_START      /* IN1 */
  655.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  656.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  657.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  658.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  659.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  660.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  661.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  662.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  663.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  664.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  665.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  666.  
  667.     PORT_START      /* DSW0 */
  668.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
  669.     PORT_DIPSETTING(    0x00, "7000" )
  670.     PORT_DIPSETTING(    0x01, "10000" )
  671.     PORT_DIPSETTING(    0x02, "12000" )
  672.     PORT_DIPSETTING(    0x03, "20000" )
  673.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
  674.     PORT_DIPSETTING(    0x00, "2" )
  675.     PORT_DIPSETTING(    0x04, "3" )
  676.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  677.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  678.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  679.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  680. INPUT_PORTS_END
  681.  
  682. INPUT_PORTS_START( superg )
  683.     PORT_START      /* IN0 */
  684.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  685.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  686.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  687.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  688.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  689.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  690.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  691.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  692.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  693.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  694.  
  695.     PORT_START      /* IN1 */
  696.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  697.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  698.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  699.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  700.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  701.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  702.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  703.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  704.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  705.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  706.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  707.  
  708.     PORT_START      /* DSW0 */
  709.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
  710.     PORT_DIPSETTING(    0x01, "4000" )
  711.     PORT_DIPSETTING(    0x02, "5000" )
  712.     PORT_DIPSETTING(    0x03, "7000" )
  713.     PORT_DIPSETTING(    0x00, "None" )
  714.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  715.     PORT_DIPSETTING(    0x00, "3" )
  716.     PORT_DIPSETTING(    0x04, "5" )
  717.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  718.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  719.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  720.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  721. INPUT_PORTS_END
  722.  
  723. INPUT_PORTS_START( zerotime )
  724.     PORT_START      /* IN0 */
  725.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  726.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  727.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  728.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  729.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  730.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  731.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  732.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  733.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  734.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  735.  
  736.     PORT_START      /* IN1 */
  737.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  738.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  739.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  740.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  741.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  742.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  743.     PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
  744.     PORT_DIPSETTING(    0x40, "A 1C/1C  B 1C/2C " )
  745.     PORT_DIPSETTING(    0xc0, "A 1C/1C  B 1C/3C " )
  746.     PORT_DIPSETTING(    0x00, "A 1C/2C  B 1C/4C " )
  747.     PORT_DIPSETTING(    0x80, "A 1C/2C  B 1C/5C " )
  748.  
  749.     PORT_START      /* DSW0 */
  750.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) )
  751.     PORT_DIPSETTING(    0x03, "6000" )
  752.     PORT_DIPSETTING(    0x02, "7000" )
  753.     PORT_DIPSETTING(    0x01, "9000" )
  754.     PORT_DIPSETTING(    0x00, "None" )
  755.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  756.     PORT_DIPSETTING(    0x00, "3" )
  757.     PORT_DIPSETTING(    0x04, "5" )
  758.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )        /* used */
  759.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  760.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  761.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  762. INPUT_PORTS_END
  763.  
  764. INPUT_PORTS_START( pisces )
  765.     PORT_START      /* IN0 */
  766.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
  767.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
  768.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  769.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  770.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  771.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  772.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  773.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  774.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  775.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  776.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  777.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  778.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  779.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  780.  
  781.     PORT_START      /* IN1 */
  782.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  783.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  784.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  785.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  786.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  787.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  788.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  789.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  790.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Lives ) )
  791.     PORT_DIPSETTING(    0x00, "3" )
  792.     PORT_DIPSETTING(    0x40, "4" )
  793.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  794.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  795.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  796.  
  797.     PORT_START      /* DSW0 */
  798.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
  799.     PORT_DIPSETTING(    0x00, "10000" )
  800.     PORT_DIPSETTING(    0x01, "20000" )
  801.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Coinage ) )
  802.     PORT_DIPSETTING(    0x02, "A 2C/1C  B 1C/2C 2C/5C" )
  803.     PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/5C" )
  804.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Difficulty ) )
  805.     PORT_DIPSETTING(    0x00, "Easy" )
  806.     PORT_DIPSETTING(    0x04, "Hard" )
  807.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  808.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  809.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  810.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  811. INPUT_PORTS_END
  812.  
  813. INPUT_PORTS_START( warofbug )
  814.     PORT_START      /* IN0 */
  815.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  816.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  817.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  818.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  819.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  820.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  821.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  822.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP   | IPF_8WAY )
  823.  
  824.     PORT_START      /* IN1 */
  825.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  826.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  827.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  828.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 )
  829.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  830.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  831.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  832.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  833.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  834.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  835. /* 0x80 gives 2 Coins/1 Credit */
  836.  
  837.     PORT_START      /* DSW0 */
  838.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  839.     PORT_DIPSETTING(    0x00, "1" )
  840.     PORT_DIPSETTING(    0x01, "2" )
  841.     PORT_DIPSETTING(    0x02, "3" )
  842.     PORT_DIPSETTING(    0x03, "4" )
  843.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  844.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  845.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  846.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Bonus_Life ) )
  847.     PORT_DIPSETTING(    0x08, "500000" )
  848.     PORT_DIPSETTING(    0x00, "750000" )
  849.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  850. INPUT_PORTS_END
  851.  
  852. INPUT_PORTS_START( redufo )
  853.     PORT_START      /* IN0 */
  854.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  855.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  856.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  857.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  858.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  859.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  860.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  861.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  862.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  863.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  864.  
  865.     PORT_START      /* IN1 */
  866.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  867.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  868.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  869.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  870.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  871.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  872.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  873.     PORT_DIPSETTING(    0x40, "A 2C/1C  B 1C/3C" )
  874.     PORT_DIPSETTING(    0x00, "A 1C/1C  B 1C/6C" )
  875.     PORT_DIPSETTING(    0x80, "A 1C/2C  B 1C/12C" )
  876.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  877.  
  878.     PORT_START      /* DSW0 */
  879.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Bonus_Life ) )
  880.     PORT_DIPSETTING(    0x01, "4000" )
  881.     PORT_DIPSETTING(    0x02, "5000" )
  882.     PORT_DIPSETTING(    0x03, "7000" )
  883.     PORT_DIPSETTING(    0x00, "None" )
  884.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  885.     PORT_DIPSETTING(    0x00, "3" )
  886.     PORT_DIPSETTING(    0x04, "5" )
  887.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  888.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  889.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  890.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  891. INPUT_PORTS_END
  892.  
  893. INPUT_PORTS_START( pacmanbl )
  894.     PORT_START      /* IN0 */
  895.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  896.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  897.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  898.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  899.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  900.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_4WAY )
  901.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  902.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_4WAY )
  903.  
  904.     PORT_START      /* IN1 */
  905.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  906.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  907.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  908.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  909.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  910.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_4WAY | IPF_COCKTAIL )
  911.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
  912.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  913.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
  914.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
  915.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
  916.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  917.  
  918.     PORT_START      /* DSW0 */
  919.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
  920.     PORT_DIPSETTING(    0x00, "15000" )
  921.     PORT_DIPSETTING(    0x01, "20000" )
  922.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
  923.     PORT_DIPSETTING(    0x00, "Easy" )
  924.     PORT_DIPSETTING(    0x02, "Hard" )
  925.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  926.     PORT_DIPSETTING(    0x00, "3" )
  927.     PORT_DIPSETTING(    0x04, "5" )
  928.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  929.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  930.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  931.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  932. INPUT_PORTS_END
  933.  
  934. INPUT_PORTS_START( devilfsg )
  935.     PORT_START      /* IN0 */
  936.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  937.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  938.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  939.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  940.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  941.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  942.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL )
  943.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_4WAY )
  944.  
  945.     PORT_START      /* IN1 */
  946.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  947.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  948.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  949.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  950.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  951.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  952.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
  953.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  954.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
  955.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
  956.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
  957.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  958.  
  959.     PORT_START      /* DSW0 */
  960.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Bonus_Life ) )
  961.     PORT_DIPSETTING(    0x00, "10000" )
  962.     PORT_DIPSETTING(    0x01, "15000" )
  963.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )   /* Probably unused */
  964.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  965.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  966.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  967.     PORT_DIPSETTING(    0x00, "4" )
  968.     PORT_DIPSETTING(    0x04, "5" )
  969.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  970.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  971.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  972.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  973. INPUT_PORTS_END
  974.  
  975. INPUT_PORTS_START( zigzag )
  976.     PORT_START      /* IN0 */
  977.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  978.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  979.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  980.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  981.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  982.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_4WAY )
  983.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY )
  984.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  985.  
  986.     PORT_START      /* IN1 */
  987.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  988.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  989.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  990.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  991.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  992.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_4WAY | IPF_COCKTAIL )
  993.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  994.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  995.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  996.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  997.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  998.  
  999.     PORT_START      /* DSW0 */
  1000.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Lives ) )
  1001.     PORT_DIPSETTING(    0x00, "3" )
  1002.     PORT_DIPSETTING(    0x01, "4" )
  1003.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
  1004.     PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
  1005.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  1006.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )
  1007.     PORT_DIPSETTING(    0x00, "10000 60000" )
  1008.     PORT_DIPSETTING(    0x04, "20000 60000" )
  1009.     PORT_DIPSETTING(    0x08, "30000 60000" )
  1010.     PORT_DIPSETTING(    0x0c, "40000 60000" )
  1011.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1012. INPUT_PORTS_END
  1013.  
  1014. INPUT_PORTS_START( mooncrgx )
  1015.     PORT_START    /* IN0 */
  1016.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1017.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1018.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1019.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1020.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1021.     PORT_BIT( 0xe0, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1022.  
  1023.     PORT_START    /* IN1 */
  1024.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1025.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1026.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  1027.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1028.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1029.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1030.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coin_A ) )
  1031.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  1032.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
  1033.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_B ) )
  1034.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
  1035.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_5C ) )
  1036.  
  1037.     PORT_START    /* DSW */
  1038.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Bonus_Life ) )
  1039.     PORT_DIPSETTING(    0x01, "30000" )
  1040.     PORT_DIPSETTING(    0x00, "50000" )
  1041.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
  1042.   /*PORT_DIPNAME( 0x04, 0x00, "Language" )    This version is always in English */
  1043.                                                           /* Code has been commented out at 0x2f4b */
  1044.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  1045.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1046.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  1047.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* probably unused */
  1048. INPUT_PORTS_END
  1049.  
  1050. INPUT_PORTS_START( scramblb )
  1051.     PORT_START    /* IN0 */
  1052.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1053.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  1054.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  1055.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1056.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1057.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  1058.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  1059.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP   | IPF_8WAY )
  1060.  
  1061.     PORT_START    /* IN1 */
  1062.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1063.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1064.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  1065.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1066.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1067.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL )
  1068.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
  1069.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1070.     PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
  1071.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  1072.  
  1073.     PORT_START    /* IN2 */
  1074.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
  1075.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1076.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_2C ) )
  1077.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_3C ) )
  1078.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_4C ) )
  1079.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Lives ) )
  1080.     PORT_DIPSETTING(    0x00, "3" )
  1081.     PORT_DIPSETTING(    0x04, "4" )
  1082.     PORT_DIPSETTING(    0x08, "5" )
  1083.     PORT_BITX( 0,       0x0c, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "255", IP_KEY_NONE, IP_JOY_NONE )
  1084.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )   /* probably unused */
  1085.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1086.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  1087.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )   /* probably unused */
  1088.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1089.     PORT_DIPSETTING(    0x20, DEF_STR( On ) )
  1090.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )   /* probably unused */
  1091.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1092.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  1093.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )   /* probably unused */
  1094.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1095.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1096. INPUT_PORTS_END
  1097.  
  1098. INPUT_PORTS_START( jumpbug )
  1099.     PORT_START      /* IN0 */
  1100.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1101.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  1102.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  1103.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1104.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1105.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1106.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1107.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1108.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  1109.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP   | IPF_8WAY )
  1110.  
  1111.     PORT_START      /* IN1 */
  1112.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1113.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1114.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  1115.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1116.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1117.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
  1118.     PORT_DIPNAME( 0x40, 0x00, "Difficulty ?" )
  1119.     PORT_DIPSETTING(    0x00, "Hard?" )
  1120.     PORT_DIPSETTING(    0x40, "Easy?" )
  1121.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  1122.  
  1123.     PORT_START      /* DSW0 */
  1124.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
  1125.     PORT_DIPSETTING(    0x01, "3" )
  1126.     PORT_DIPSETTING(    0x02, "4" )
  1127.     PORT_DIPSETTING(    0x03, "5" )
  1128.     PORT_BITX( 0,       0x00, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "Infinite", IP_KEY_NONE, IP_JOY_NONE )
  1129.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
  1130.     PORT_DIPSETTING(    0x04, "2/1 2/1" )
  1131.     PORT_DIPSETTING(    0x08, "2/1 1/3" )
  1132.     PORT_DIPSETTING(    0x00, "1/1 1/1" )
  1133.     PORT_DIPSETTING(    0x0c, "1/1 1/6" )
  1134.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
  1135.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1136.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1137.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  1138.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1139.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1140.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  1141.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1142.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1143.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
  1144.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1145.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1146. INPUT_PORTS_END
  1147.  
  1148. INPUT_PORTS_START( levers )
  1149.     PORT_START      /* IN0 */
  1150.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1151.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  1152.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1153.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1154.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1155.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
  1156.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1157.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1158.  
  1159.     PORT_START      /* IN1 */
  1160.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1161.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1162.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  1163.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1164.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1165.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
  1166.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1167.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1168.  
  1169.     PORT_START      /* DSW0 */
  1170.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )    /* probably unused */
  1171.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  1172.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1173.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )  /* probably unused */
  1174.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  1175.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1176.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )    /* used */
  1177.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  1178.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1179.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Free_Play ) )
  1180.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1181.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  1182.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )    /* probably unused */
  1183.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1184.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1185.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )  /* probably unused */
  1186.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1187.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1188.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )    /* probably unused */
  1189.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1190.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1191.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )    /* probably unused */
  1192.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1193.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1194. INPUT_PORTS_END
  1195.  
  1196. INPUT_PORTS_START( azurian )
  1197.     PORT_START      /* IN0 */
  1198.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  1199.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  1200.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1201.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  1202.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
  1203.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1204.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1205.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1206.  
  1207.     PORT_START      /* IN1 */
  1208.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1209.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1210.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  1211.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_COCKTAIL )
  1212.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1213.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_COCKTAIL )
  1214.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )        /* used */
  1215.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1216.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1217.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Lives ) )
  1218.     PORT_DIPSETTING(    0x00, "3" )
  1219.     PORT_DIPSETTING(    0x80, "5" )
  1220.  
  1221.     PORT_START      /* DSW0 */
  1222.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) )
  1223.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1224.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1225.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Bonus_Life ) )
  1226.     PORT_DIPSETTING(    0x00, "5000" )
  1227.     PORT_DIPSETTING(    0x02, "7000" )
  1228.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )        /* used */
  1229.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  1230.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1231.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  1232.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1233.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  1234.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1235. INPUT_PORTS_END
  1236.  
  1237. INPUT_PORTS_START( orbitron )
  1238.     PORT_START      /* IN0 */
  1239.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1240.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1241.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY )
  1242.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  1243.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1244.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_COCKTAIL )
  1245.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY )
  1246.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY )
  1247.  
  1248.     PORT_START      /* IN1 */
  1249.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1250.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1251.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  1252.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  1253.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1254.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
  1255.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1256.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1257.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )
  1258.     PORT_DIPSETTING(    0x00, "A 2C/1C  B 1C/3C" )
  1259.     PORT_DIPSETTING(    0x40, "A 1C/1C  B 1C/6C" )
  1260.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  1261.  
  1262.     PORT_START      /* DSW0 */
  1263.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  1264.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  1265.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1266.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  1267.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  1268.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1269.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  1270.     PORT_DIPSETTING(    0x04, "2" )
  1271.     PORT_DIPSETTING(    0x00, "3" )
  1272.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
  1273.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1274.     PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
  1275.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1276. INPUT_PORTS_END
  1277.  
  1278. INPUT_PORTS_START( checkmaj )
  1279.     PORT_START    /* IN0 */
  1280.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1281.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1282.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
  1283.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
  1284.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
  1285.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL) /* p2 tiles right */
  1286.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_COCKTAIL )
  1287.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
  1288.  
  1289.     PORT_START    /* IN1 */
  1290.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1291.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1292.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_COCKTAIL )
  1293.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
  1294.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_COCKTAIL )
  1295.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL) /* p2 tiles left */
  1296.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
  1297.     PORT_DIPSETTING(    0x00, "A 1/1 B 1/6" )
  1298.     PORT_DIPSETTING(    0x40, "A 2/1 B 1/3" )
  1299.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  1300.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1301.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1302.  
  1303.     PORT_START    /* DSW */
  1304.      PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  1305.     PORT_DIPSETTING(    0x00, "3" )
  1306.     PORT_DIPSETTING(    0x01, "4" )
  1307.     PORT_DIPSETTING(    0x02, "5" )
  1308.     PORT_DIPSETTING(    0x03, "6" )
  1309.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
  1310.     PORT_DIPSETTING(    0x00, "100000" )
  1311.     PORT_DIPSETTING(    0x04, "200000" )
  1312.     PORT_DIPNAME( 0x08, 0x00, "Difficulty Increases At Level" )
  1313.     PORT_DIPSETTING(    0x08, "3" )
  1314.     PORT_DIPSETTING(    0x00, "5" )
  1315.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) /* p1 tiles right */
  1316.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 ) /* p1 tiles left */
  1317. INPUT_PORTS_END
  1318.  
  1319. INPUT_PORTS_START( swarm )
  1320.     PORT_START      /* IN0 */
  1321.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1322.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1323.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1324.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1325.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1326.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1327.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1328.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1329.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  1330.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  1331.  
  1332.     PORT_START      /* IN1 */
  1333.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1334.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1335.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  1336.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1337.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1338.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1339.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  1340.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  1341.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1342.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  1343.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  1344.  
  1345.     PORT_START      /* DSW0 */
  1346.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
  1347.     PORT_DIPSETTING(    0x01, "10000" )
  1348.     PORT_DIPSETTING(    0x02, "20000" )
  1349.     PORT_DIPSETTING(    0x03, "40000" )
  1350.     PORT_DIPSETTING(    0x00, "None" )
  1351.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  1352.     PORT_DIPSETTING(    0x00, "3" )
  1353.     PORT_DIPSETTING(    0x04, "4" )
  1354.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  1355.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1356.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  1357.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1358. INPUT_PORTS_END
  1359.  
  1360. INPUT_PORTS_START( streakng )
  1361.     PORT_START      /* IN0 */
  1362.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1363.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_4WAY | IPF_COCKTAIL)
  1364.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY )
  1365.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY )
  1366.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
  1367.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1368.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1369.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1370.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_4WAY )
  1371.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_4WAY )
  1372.  
  1373.     PORT_START      /* IN1 */
  1374.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1375.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1376.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_4WAY | IPF_COCKTAIL )
  1377.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_4WAY | IPF_COCKTAIL )
  1378.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED )
  1379.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_4WAY | IPF_COCKTAIL )
  1380.     PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Bonus_Life ) )
  1381.     PORT_DIPSETTING(    0x00, "None" )
  1382.     PORT_DIPSETTING(    0x40, "10000" )
  1383.     PORT_DIPSETTING(    0x80, "15000" )
  1384.     PORT_DIPSETTING(    0xc0, "20000" )
  1385.  
  1386.     PORT_START      /* DSW0 */
  1387.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coinage ) )
  1388.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
  1389.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_1C ) )
  1390.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  1391.     PORT_DIPSETTING(    0x03, DEF_STR( Free_Play ) )
  1392.     PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Lives ) )
  1393.     PORT_DIPSETTING(    0x0c, "1" )
  1394.     PORT_DIPSETTING(    0x08, "2" )
  1395.     PORT_DIPSETTING(    0x04, "3" )
  1396.     PORT_DIPSETTING(    0x00, "5" )
  1397.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1398. INPUT_PORTS_END
  1399.  
  1400. INPUT_PORTS_START( blkhole )
  1401.     PORT_START      /* IN0 */
  1402.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1403.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1404.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1405.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1406.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1407.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1408.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1409.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  1410.  
  1411.     PORT_START      /* IN1 */
  1412.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1413.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1414.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  1415.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1416.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1417.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1418.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  1419.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
  1420.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1421.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_2C ) )
  1422.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_3C ) )
  1423.  
  1424.     PORT_START      /* DSW0 */
  1425.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )    /* Bonus Life? */
  1426.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1427.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  1428.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) )
  1429.     PORT_DIPSETTING(    0x02, DEF_STR( Upright ) )
  1430.     PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
  1431.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
  1432.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1433.     PORT_DIPSETTING(    0x04, DEF_STR( On ) )
  1434.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  1435.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1436.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  1437.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1438. INPUT_PORTS_END
  1439.  
  1440. INPUT_PORTS_START( mooncrst )
  1441.     PORT_START    /* IN0 */
  1442.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1443.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1444.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1445.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1446.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1447.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1448.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1449.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1450.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* "reset" on schematics */
  1451.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )    /* works only in the Gremlin version */
  1452.  
  1453.     PORT_START    /* IN1 */
  1454.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1455.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1456.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  1457.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1458.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1459.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1460.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
  1461.     PORT_DIPSETTING(    0x00, "30000" )
  1462.     PORT_DIPSETTING(    0x40, "50000" )
  1463.     PORT_DIPNAME( 0x80, 0x80, "Language" )
  1464.     PORT_DIPSETTING(    0x80, "English" )
  1465.     PORT_DIPSETTING(    0x00, "Japanese" )
  1466.  
  1467.     PORT_START    /* DSW */
  1468.      PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  1469.     PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
  1470.     PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
  1471.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1472.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1473.      PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
  1474.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1475.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  1476.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  1477.     PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
  1478.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1479. INPUT_PORTS_END
  1480.  
  1481. INPUT_PORTS_START( eagle )
  1482.     PORT_START    /* IN0 */
  1483.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1484.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1485.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1486.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1487.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1488.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1489.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1490.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1491.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* "reset" on schematics */
  1492.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1493.  
  1494.     PORT_START    /* IN1 */
  1495.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1496.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1497.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  1498.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1499.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1500.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1501.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
  1502.     PORT_DIPSETTING(    0x00, "30000" )
  1503.     PORT_DIPSETTING(    0x40, "50000" )
  1504.     PORT_DIPNAME( 0x80, 0x80, "Language" )
  1505.     PORT_DIPSETTING(    0x80, "English" )
  1506.     PORT_DIPSETTING(    0x00, "Japanese" )
  1507.  
  1508.     PORT_START    /* DSW */
  1509.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )
  1510.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1511.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  1512.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
  1513.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1514.     PORT_DIPSETTING(    0x02, DEF_STR( On ) )
  1515.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) )
  1516.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1517.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  1518.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  1519.     PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
  1520.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1521. INPUT_PORTS_END
  1522.  
  1523. INPUT_PORTS_START( eagle2 )
  1524.     PORT_START    /* IN0 */
  1525.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1526.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1527.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1528.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1529.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1530.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1531.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1532.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1533.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* "reset" on schematics */
  1534.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1535.  
  1536.     PORT_START    /* IN1 */
  1537.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1538.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1539.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY | IPF_COCKTAIL )
  1540.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1541.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1542.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1543.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Bonus_Life ) )
  1544.     PORT_DIPSETTING(    0x00, "30000" )
  1545.     PORT_DIPSETTING(    0x40, "50000" )
  1546.     PORT_DIPNAME( 0x80, 0x80, "Language" )
  1547.     PORT_DIPSETTING(    0x80, "English" )
  1548.     PORT_DIPSETTING(    0x00, "Japanese" )
  1549.  
  1550.     PORT_START    /* DSW */
  1551.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) )
  1552.     PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
  1553.     PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
  1554.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1555.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1556.     PORT_DIPNAME( 0x0c, 0x00, "Game Type" )
  1557.     PORT_DIPSETTING(    0x00, "Normal 1?" )
  1558.     PORT_DIPSETTING(    0x04, "Normal 2?" )
  1559.     PORT_DIPSETTING(    0x08, "Normal 3?" )
  1560.     PORT_DIPSETTING(    0x0c, DEF_STR ( Free_Play ) )
  1561.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1562. INPUT_PORTS_END
  1563.  
  1564. INPUT_PORTS_START( moonqsr )
  1565.     PORT_START      /* IN0 */
  1566.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1567.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1568.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_2WAY )
  1569.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1570.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1571.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1572.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1573.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1574.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* "reset" on schematics */
  1575.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
  1576.  
  1577.     PORT_START      /* IN1 */
  1578.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1579.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1580.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_PLAYER2 )
  1581.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_PLAYER2 )
  1582.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  1583.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1584.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Difficulty ) )
  1585.     PORT_DIPSETTING(    0x00, "Easy" )
  1586.     PORT_DIPSETTING(    0x40, "Medium" )
  1587.     PORT_DIPSETTING(    0x80, "Hard" )
  1588.     PORT_DIPSETTING(    0xc0, "Hardest" )
  1589.  
  1590.     PORT_START      /* DSW1 */
  1591.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  1592.     PORT_DIPSETTING(    0x03, DEF_STR( 4C_1C ) )
  1593.     PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
  1594.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  1595.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1596.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
  1597.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1598.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  1599.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_3C ) )
  1600.     PORT_DIPSETTING(    0x0c, DEF_STR( Free_Play ) )
  1601.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1602. INPUT_PORTS_END
  1603.  
  1604. INPUT_PORTS_START( checkman )
  1605.     PORT_START    /* IN0 */
  1606.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN2 )
  1607.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 )
  1608.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
  1609.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
  1610.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_COCKTAIL ) /* p2 tiles right */
  1611.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
  1612.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_COCKTAIL )
  1613.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
  1614.  
  1615.     PORT_START    /* IN1 */
  1616.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) /* also p1 tiles left */
  1617.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) /* also p1 tiles right */
  1618.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_COCKTAIL )
  1619.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_COCKTAIL )
  1620.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL ) /* p2 tiles left */
  1621.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_COCKTAIL )
  1622.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Coinage ) )
  1623.     PORT_DIPSETTING(    0x00, "A 1/1 B 1/6" )
  1624.     PORT_DIPSETTING(    0x40, "A 2/1 B 1/3" )
  1625.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  1626.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1627.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1628.  
  1629.     PORT_START    /* DSW */
  1630.      PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
  1631.     PORT_DIPSETTING(    0x00, "3" )
  1632.     PORT_DIPSETTING(    0x01, "4" )
  1633.     PORT_DIPSETTING(    0x02, "5" )
  1634.     PORT_DIPSETTING(    0x03, "6" )
  1635.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
  1636.     PORT_DIPSETTING(    0x00, "100000" )
  1637.     PORT_DIPSETTING(    0x04, "200000" )
  1638.     PORT_DIPNAME( 0x08, 0x00, "Difficulty Increases At Level" )
  1639.     PORT_DIPSETTING(    0x08, "3" )
  1640.     PORT_DIPSETTING(    0x00, "5" )
  1641.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1642. INPUT_PORTS_END
  1643.  
  1644. INPUT_PORTS_START( moonal2 )
  1645.     PORT_START    /* IN0 */
  1646.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1647.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1648.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY )
  1649.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1650.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1651.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1652.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1653.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1654.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  1655.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )    /* works only in the Gremlin version */
  1656.  
  1657.     PORT_START    /* IN1 */
  1658.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1659.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1660.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_COCKTAIL )
  1661.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1662.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1663.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* probably unused */
  1664.     PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coinage ) )
  1665.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  1666.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  1667.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  1668.     PORT_DIPSETTING(    0xc0, DEF_STR( Free_Play ) )
  1669.  
  1670.     PORT_START    /* DSW */
  1671.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
  1672.     PORT_DIPSETTING(    0x01, "4000" )
  1673.     PORT_DIPSETTING(    0x02, "5000" )
  1674.     PORT_DIPSETTING(    0x03, "7000" )
  1675.     PORT_DIPSETTING(    0x00, "None" )
  1676.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Lives ) )
  1677.     PORT_DIPSETTING(    0x00, "3" )
  1678.     PORT_DIPSETTING(    0x04, "5" )
  1679.     PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
  1680.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1681.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  1682.     PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED )
  1683. INPUT_PORTS_END
  1684.  
  1685. INPUT_PORTS_START( kingball )
  1686.     PORT_START      /* IN1 */
  1687.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1688.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1689.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY )
  1690.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  1691.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  1692.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  1693.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1694.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  1695.     PORT_SERVICE( 0x40, IP_ACTIVE_HIGH )
  1696.     /* Hack? - possibly multiplexed via writes to $b003 */
  1697.     PORT_DIPNAME( 0x80, 0x80, "Speech" )
  1698.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1699.     PORT_DIPSETTING(    0x80, DEF_STR( On ) )
  1700.  
  1701.     PORT_START      /* IN1 */
  1702.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
  1703.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
  1704.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_COCKTAIL )
  1705.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  1706.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  1707.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK )
  1708.     PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Coinage ) )
  1709.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
  1710.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_1C ) )
  1711.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  1712.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  1713.  
  1714.     PORT_START    /* DSW */
  1715.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Bonus_Life ) )
  1716.     PORT_DIPSETTING(    0x00, "10000" )
  1717.     PORT_DIPSETTING(    0x01, "12000" )
  1718.     PORT_DIPSETTING(    0x02, "15000" )
  1719.     PORT_DIPSETTING(    0x03, "None" )
  1720.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
  1721.     PORT_DIPSETTING(    0x00, "2" )
  1722.     PORT_DIPSETTING(    0x04, "3" )
  1723.     PORT_DIPNAME( 0xf8, 0x00, DEF_STR( Unknown ) )
  1724.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  1725.     PORT_DIPSETTING(    0xf8, DEF_STR( On ) )
  1726. INPUT_PORTS_END
  1727.  
  1728.  
  1729. static struct GfxLayout galaxian_charlayout =
  1730. {
  1731.     8,8,    /* 8*8 characters */
  1732.     RGN_FRAC(1,2),
  1733.     2,    /* 2 bits per pixel */
  1734.     { RGN_FRAC(0,2), RGN_FRAC(1,2) },    /* the two bitplanes are separated */
  1735.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1736.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1737.     8*8    /* every char takes 8 consecutive bytes */
  1738. };
  1739. static struct GfxLayout galaxian_spritelayout =
  1740. {
  1741.     16,16,    /* 16*16 sprites */
  1742.     RGN_FRAC(1,2),    /* 64 sprites */
  1743.     2,    /* 2 bits per pixel */
  1744.     { RGN_FRAC(0,2), RGN_FRAC(1,2) },    /* the two bitplanes are separated */
  1745.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1746.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1747.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1748.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1749.     32*8    /* every sprite takes 32 consecutive bytes */
  1750. };
  1751.  
  1752. static struct GfxLayout pacmanbl_charlayout =
  1753. {
  1754.     8,8,    /* 8*8 characters */
  1755.     256,    /* 256 characters */
  1756.     2,    /* 2 bits per pixel */
  1757.     { 0, 256*8*8 },    /* the two bitplanes are separated */
  1758.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  1759.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  1760.     8*8    /* every char takes 8 consecutive bytes */
  1761. };
  1762. static struct GfxLayout pacmanbl_spritelayout =
  1763. {
  1764.     16,16,    /* 16*16 sprites */
  1765.     64,    /* 64 sprites */
  1766.     2,    /* 2 bits per pixel */
  1767.     { 0, 64*16*16 },    /* the two bitplanes are separated */
  1768.     { 0, 1, 2, 3, 4, 5, 6, 7,
  1769.             8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  1770.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  1771.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  1772.     32*8    /* every sprite takes 32 consecutive bytes */
  1773. };
  1774.  
  1775. static struct GfxLayout bulletlayout =
  1776. {
  1777.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1778.     3,1,    /* 3*1 line */
  1779.     1,    /* just one */
  1780.     1,    /* 1 bit per pixel */
  1781.     { 0 },
  1782.     { 2, 2, 2 },    /* I "know" that this bit of the */
  1783.     { 0 },            /* graphics ROMs is 1 */
  1784.     0    /* no use */
  1785. };
  1786. static struct GfxLayout scramble_bulletlayout =
  1787. {
  1788.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1789.     7,1,    /* it's just 1 pixel, but we use 7*1 to position it correctly */
  1790.     1,    /* just one */
  1791.     1,    /* 1 bit per pixel */
  1792.     { 0 },
  1793.     { 3, 0, 0, 0, 0, 0, 0 },    /* I "know" that this bit of the */
  1794.     { 0 },                        /* graphics ROMs is 1 */
  1795.     0    /* no use */
  1796. };
  1797. static struct GfxLayout backgroundlayout =
  1798. {
  1799.     /* there is no gfx ROM for this one, it is generated by the hardware */
  1800.     8,8,
  1801.     32,    /* one for each column */
  1802.     7,    /* 128 colors max */
  1803.     { 1, 2, 3, 4, 5, 6, 7 },
  1804.     { 0*8*8, 1*8*8, 2*8*8, 3*8*8, 4*8*8, 5*8*8, 6*8*8, 7*8*8 },
  1805.     { 0, 8, 16, 24, 32, 40, 48, 56 },
  1806.     8*8*8    /* each character takes 64 bytes */
  1807. };
  1808.  
  1809.  
  1810. static struct GfxDecodeInfo galaxian_gfxdecodeinfo[] =
  1811. {
  1812.     { REGION_GFX1, 0x0000, &galaxian_charlayout,    0, 8 },
  1813.     { REGION_GFX1, 0x0000, &galaxian_spritelayout,  0, 8 },
  1814.     { REGION_GFX1, 0x0000, &bulletlayout,         8*4, 2 },
  1815.     { 0,           0x0000, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1816.     { -1 } /* end of array */
  1817. };
  1818.  
  1819. static struct GfxDecodeInfo scramble_gfxdecodeinfo[] =
  1820. {
  1821.     { REGION_GFX1, 0x0000, &galaxian_charlayout,    0, 8 },
  1822.     { REGION_GFX1, 0x0000, &galaxian_spritelayout,  0, 8 },
  1823.     { REGION_GFX1, 0x0000, &scramble_bulletlayout,8*4, 1 },    /* 1 color code instead of 2, so all */
  1824.                                                     /* shots will be yellow */
  1825.     { 0,           0x0000, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1826.     { -1 } /* end of array */
  1827. };
  1828.  
  1829. /* separate character and sprite ROMs */
  1830. static struct GfxDecodeInfo pacmanbl_gfxdecodeinfo[] =
  1831. {
  1832.     { REGION_GFX1, 0x0000, &pacmanbl_charlayout,    0, 8 },
  1833.     { REGION_GFX1, 0x1000, &pacmanbl_spritelayout,  0, 8 },
  1834.     { REGION_GFX1, 0x0000, &bulletlayout,         8*4, 2 },
  1835.     { 0,           0x0000, &backgroundlayout, 8*4+2*2, 1 },    /* this will be dynamically created */
  1836.     { -1 } /* end of array */
  1837. };
  1838.  
  1839.  
  1840. static struct CustomSound_interface custom_interface =
  1841. {
  1842.     galaxian_sh_start,
  1843.     galaxian_sh_stop,
  1844.     galaxian_sh_update
  1845. };
  1846.  
  1847. static struct AY8910interface jumpbug_ay8910_interface =
  1848. {
  1849.     1,    /* 1 chip */
  1850.     1789750,    /* 1.78975 MHz? */
  1851.     { 50 },
  1852.     { 0 },
  1853.     { 0 },
  1854.     { 0 },
  1855.     { 0 }
  1856. };
  1857.  
  1858. static struct AY8910interface checkmaj_ay8910_interface =
  1859. {
  1860.     1,    /* 1 chip */
  1861.     1620000,    /* 1.62 MHz? (Used the same as Moon Cresta) */
  1862.     { 50 },
  1863.     { soundlatch_r },
  1864.     { 0 },
  1865.     { 0 },
  1866.     { 0 }
  1867. };
  1868.  
  1869. static struct DACinterface kingball_dac_interface =
  1870. {
  1871.     1,
  1872.     { 100 }
  1873. };
  1874.  
  1875.  
  1876. #define MACHINE_DRIVER(NAME, MEM, INT, INIT, GFX, VHSTART)                        \
  1877.                                                                                 \
  1878. static struct MachineDriver machine_driver_##NAME =                                \
  1879. {                                                                                \
  1880.     /* basic machine hardware */                                                \
  1881.     {                                                                            \
  1882.         {                                                                        \
  1883.             CPU_Z80,                                                            \
  1884.             18432000/6,    /* 3.072 Mhz */                                            \
  1885.             MEM##_readmem,MEM##_writemem,0,0,                                    \
  1886.             INT##_vh_interrupt,1                                                \
  1887.         }                                                                        \
  1888.     },                                                                            \
  1889.     16000.0/132/2, 2500,    /* frames per second, vblank duration */                \
  1890.     1,    /* single CPU, no need for interleaving */                                \
  1891.     INIT,                                                                        \
  1892.                                                                                 \
  1893.     /* video hardware */                                                        \
  1894.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },                                    \
  1895.     GFX##_gfxdecodeinfo,                                                        \
  1896.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */    \
  1897.     galaxian_vh_convert_color_prom,                                                \
  1898.                                                                                 \
  1899.     VIDEO_TYPE_RASTER,                                                            \
  1900.     0,                                                                            \
  1901.     VHSTART##_vh_start,                                                            \
  1902.     generic_vh_stop,                                                            \
  1903.     galaxian_vh_screenrefresh,                                                    \
  1904.                                                                                 \
  1905.     /* sound hardware */                                                        \
  1906.     0,0,0,0,                                                                    \
  1907.     {                                                                            \
  1908.         {                                                                        \
  1909.             SOUND_CUSTOM,                                                        \
  1910.             &custom_interface                                                    \
  1911.         }                                                                        \
  1912.     }                                                                            \
  1913. };
  1914.  
  1915. /*                         MEM         INTERRUPT  MACHINE_INIT           GFXDECODE  VH_START */
  1916. MACHINE_DRIVER(galaxian, galaxian, galaxian,  machine_init_galaxian, galaxian,  galaxian)
  1917. MACHINE_DRIVER(warofbug, galaxian, galaxian,  0,                     galaxian,  galaxian)
  1918. MACHINE_DRIVER(galapx,   galaxian, galaxian,  machine_init_galapx,   galaxian,  galaxian)
  1919. MACHINE_DRIVER(pisces,   galaxian, galaxian,  0,                     galaxian,  pisces)
  1920. MACHINE_DRIVER(mooncrgx, galaxian, galaxian,  0,                     galaxian,  mooncrgx)
  1921. MACHINE_DRIVER(pacmanbl, galaxian, galaxian,  0,                     pacmanbl,  galaxian)
  1922. MACHINE_DRIVER(devilfsg, galaxian, devilfsg,  0,                     pacmanbl,  galaxian)
  1923. MACHINE_DRIVER(azurian,  galaxian, galaxian,  0,                     scramble,  galaxian)
  1924. MACHINE_DRIVER(scramblb, scramblb, scramble,  0,                     scramble,  scramble)
  1925. MACHINE_DRIVER(mooncrst, mooncrst, galaxian,  0,                     galaxian,     mooncrst)
  1926. MACHINE_DRIVER(moonqsr,  mooncrst, galaxian,  0,                     galaxian,     moonqsr)
  1927.  
  1928.  
  1929. static struct MachineDriver machine_driver_zigzag =
  1930. {
  1931.     /* basic machine hardware */
  1932.     {
  1933.         {
  1934.             CPU_Z80,
  1935.             18432000/6,    /* 3.072 Mhz */
  1936.             zigzag_readmem,zigzag_writemem,0,0,
  1937.             nmi_interrupt,1
  1938.         }
  1939.     },
  1940.     16000.0/132/2, 2500,    /* frames per second, vblank duration */
  1941.     1,    /* single CPU, no need for interleaving */
  1942.     0,
  1943.  
  1944.     /* video hardware */
  1945.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1946.     pacmanbl_gfxdecodeinfo,
  1947.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1948.     galaxian_vh_convert_color_prom,
  1949.  
  1950.     VIDEO_TYPE_RASTER,
  1951.     0,
  1952.     zigzag_vh_start,
  1953.     generic_vh_stop,
  1954.     galaxian_vh_screenrefresh,
  1955.  
  1956.     /* sound hardware */
  1957.     0,0,0,0,
  1958.     {
  1959.         {
  1960.             SOUND_AY8910,
  1961.             &jumpbug_ay8910_interface
  1962.         }
  1963.     }
  1964. };
  1965.  
  1966. static struct MachineDriver machine_driver_jumpbug =
  1967. {
  1968.     /* basic machine hardware */
  1969.     {
  1970.         {
  1971.             CPU_Z80,
  1972.             3072000,    /* 3.072 Mhz */
  1973.             jumpbug_readmem,jumpbug_writemem,0,0,
  1974.             jumpbug_vh_interrupt,1
  1975.         }
  1976.     },
  1977.     16000.0/132/2, 2500,    /* frames per second, vblank duration */
  1978.     1,    /* single CPU, no need for interleaving */
  1979.     0,
  1980.  
  1981.     /* video hardware */
  1982.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1983.     galaxian_gfxdecodeinfo,
  1984.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  1985.     galaxian_vh_convert_color_prom,
  1986.  
  1987.     VIDEO_TYPE_RASTER,
  1988.     0,
  1989.     jumpbug_vh_start,
  1990.     generic_vh_stop,
  1991.     galaxian_vh_screenrefresh,
  1992.  
  1993.     /* sound hardware */
  1994.     0,0,0,0,
  1995.     {
  1996.         {
  1997.             SOUND_AY8910,
  1998.             &jumpbug_ay8910_interface
  1999.         }
  2000.     }
  2001. };
  2002.  
  2003. static struct MachineDriver machine_driver_checkman =
  2004. {
  2005.     /* basic machine hardware */
  2006.     {
  2007.         {
  2008.             CPU_Z80,
  2009.             18432000/6,    /* 3.072 MHz */
  2010.             mooncrst_readmem,mooncrst_writemem,0,checkman_writeport,
  2011.             galaxian_vh_interrupt,1
  2012.         },
  2013.         {
  2014.             CPU_Z80 | CPU_AUDIO_CPU,
  2015.             1620000,    /* 1.62 MHz */
  2016.             checkman_sound_readmem,checkman_sound_writemem,
  2017.             checkman_sound_readport,checkman_sound_writeport,
  2018.             interrupt,1    /* NMIs are triggered by the main CPU */
  2019.         }
  2020.     },
  2021.     16000.0/132/2, 2500,    /* frames per second, vblank duration */
  2022.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2023.     0,
  2024.  
  2025.     /* video hardware */
  2026.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  2027.     galaxian_gfxdecodeinfo,
  2028.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  2029.     galaxian_vh_convert_color_prom,
  2030.  
  2031.     VIDEO_TYPE_RASTER,
  2032.     0,
  2033.     mooncrst_vh_start,
  2034.     generic_vh_stop,
  2035.     galaxian_vh_screenrefresh,
  2036.  
  2037.     /* sound hardware */
  2038.     0,0,0,0,
  2039.     {
  2040.         {
  2041.             SOUND_CUSTOM,
  2042.             &custom_interface
  2043.         },
  2044.         {
  2045.             SOUND_AY8910,
  2046.             &jumpbug_ay8910_interface
  2047.         }
  2048.     }
  2049. };
  2050.  
  2051. static struct MachineDriver machine_driver_checkmaj =
  2052. {
  2053.     /* basic machine hardware */
  2054.     {
  2055.         {
  2056.             CPU_Z80,
  2057.             3072000,    /* 3.072 Mhz */
  2058.             galaxian_readmem,checkmaj_writemem,0,0,
  2059.             galaxian_vh_interrupt,1
  2060.         },
  2061.         {
  2062.             CPU_Z80 | CPU_AUDIO_CPU,
  2063.             1620000,    /* 1.62 MHz? (used the same as Moon Cresta) */
  2064.             checkmaj_sound_readmem,checkmaj_sound_writemem,0,0,
  2065.             interrupt,32    /* NMIs are triggered by the main CPU */
  2066.         }
  2067.     },
  2068.     16000.0/132/2, 2500,    /* frames per second, vblank duration */
  2069.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2070.     0,
  2071.  
  2072.     /* video hardware */
  2073.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  2074.     galaxian_gfxdecodeinfo,
  2075.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  2076.     galaxian_vh_convert_color_prom,
  2077.  
  2078.     VIDEO_TYPE_RASTER,
  2079.     0,
  2080.     galaxian_vh_start,
  2081.     generic_vh_stop,
  2082.     galaxian_vh_screenrefresh,
  2083.  
  2084.     /* sound hardware */
  2085.     0,0,0,0,
  2086.     {
  2087.         {
  2088.             SOUND_AY8910,
  2089.             &checkmaj_ay8910_interface
  2090.         }
  2091.     }
  2092. };
  2093.  
  2094.  
  2095. static struct MachineDriver machine_driver_kingball =
  2096. {
  2097.     /* basic machine hardware */
  2098.     {
  2099.         {
  2100.             CPU_Z80,
  2101.             18432000/6,    /* 3.072 Mhz? */
  2102.             mooncrst_readmem,kingball_writemem,0,0,
  2103.             galaxian_vh_interrupt,1
  2104.         },
  2105.         {
  2106.             CPU_Z80 | CPU_AUDIO_CPU,
  2107.             2500000,    /* 2.5 MHz */
  2108.             kingball_sound_readmem,kingball_sound_writemem,
  2109.             kingball_sound_readport,kingball_sound_writeport,
  2110.             interrupt,1    /* NMIs are triggered by the main CPU */
  2111.         }
  2112.     },
  2113.     16000.0/132/2, 2500,    /* frames per second, vblank duration */
  2114.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  2115.     machine_init_kingball,
  2116.  
  2117.     /* video hardware */
  2118.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  2119.     galaxian_gfxdecodeinfo,
  2120.     32+64+1,8*4+2*2+128*1,    /* 32 for the characters, 64 for the stars, 1 for background */
  2121.     galaxian_vh_convert_color_prom,
  2122.  
  2123.     VIDEO_TYPE_RASTER,
  2124.     0,
  2125.     galaxian_vh_start,
  2126.     generic_vh_stop,
  2127.     galaxian_vh_screenrefresh,
  2128.  
  2129.     /* sound hardware */
  2130.     0,0,0,0,
  2131.     {
  2132.         {
  2133.             SOUND_CUSTOM,
  2134.             &custom_interface
  2135.         },
  2136.         {
  2137.             SOUND_DAC,
  2138.             &kingball_dac_interface
  2139.         }
  2140.     }
  2141. };
  2142.  
  2143.  
  2144. /***************************************************************************
  2145.  
  2146.   Game driver(s)
  2147.  
  2148. ***************************************************************************/
  2149.  
  2150. ROM_START( galaxian )
  2151.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2152.     ROM_LOAD( "galmidw.u",    0x0000, 0x0800, 0x745e2d61 )
  2153.     ROM_LOAD( "galmidw.v",    0x0800, 0x0800, 0x9c999a40 )
  2154.     ROM_LOAD( "galmidw.w",    0x1000, 0x0800, 0xb5894925 )
  2155.     ROM_LOAD( "galmidw.y",    0x1800, 0x0800, 0x6b3ca10b )
  2156.     ROM_LOAD( "7l",           0x2000, 0x0800, 0x1b933207 )
  2157.  
  2158.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2159.     ROM_LOAD( "1h",           0x0000, 0x0800, 0x39fb43a4 )
  2160.     ROM_LOAD( "1k",           0x0800, 0x0800, 0x7e3f56a2 )
  2161.  
  2162.     ROM_REGION( 0x0020, REGION_PROMS )
  2163.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2164. ROM_END
  2165.  
  2166. ROM_START( galmidw )
  2167.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2168.     ROM_LOAD( "galmidw.u",    0x0000, 0x0800, 0x745e2d61 )
  2169.     ROM_LOAD( "galmidw.v",    0x0800, 0x0800, 0x9c999a40 )
  2170.     ROM_LOAD( "galmidw.w",    0x1000, 0x0800, 0xb5894925 )
  2171.     ROM_LOAD( "galmidw.y",    0x1800, 0x0800, 0x6b3ca10b )
  2172.     ROM_LOAD( "galmidw.z",    0x2000, 0x0800, 0xcb24f797 )
  2173.  
  2174.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2175.     ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, 0x84decf98 )
  2176.     ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, 0xc31ada9e )
  2177.  
  2178.     ROM_REGION( 0x0020, REGION_PROMS )
  2179.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2180. ROM_END
  2181.  
  2182. ROM_START( superg )
  2183.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2184.     ROM_LOAD( "superg.u",     0x0000, 0x0800, 0xe8f3aa67 )
  2185.     ROM_LOAD( "superg.v",     0x0800, 0x0800, 0xf58283e3 )
  2186.     ROM_LOAD( "superg.w",     0x1000, 0x0800, 0xddeabdae )
  2187.     ROM_LOAD( "superg.y",     0x1800, 0x0800, 0x9463f753 )
  2188.     ROM_LOAD( "superg.z",     0x2000, 0x0800, 0xe6312e35 )
  2189.  
  2190.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2191.     ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, 0x84decf98 )
  2192.     ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, 0xc31ada9e )
  2193.  
  2194.     ROM_REGION( 0x0020, REGION_PROMS )
  2195.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2196. ROM_END
  2197.  
  2198. ROM_START( galaxb )
  2199.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2200.     ROM_LOAD( "superg.u",     0x0000, 0x0800, 0xe8f3aa67 )
  2201.     ROM_LOAD( "superg.v",     0x0800, 0x0800, 0xf58283e3 )
  2202.     ROM_LOAD( "cp3",          0x1000, 0x0800, 0x4c7031c0 )
  2203.     ROM_LOAD( "cp4",          0x1800, 0x0800, 0x097d92a2 )
  2204.     ROM_LOAD( "cp5",          0x2000, 0x0800, 0x5341d75a )
  2205.  
  2206.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2207.     ROM_LOAD( "cp7e",         0x0000, 0x0800, 0xd0ba22c9 )   /* logo was removed */
  2208.     ROM_LOAD( "cp6e",         0x0800, 0x0800, 0x977e37cf )
  2209.  
  2210.     ROM_REGION( 0x0020, REGION_PROMS )
  2211.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2212. ROM_END
  2213.  
  2214. ROM_START( galapx )
  2215.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2216.     ROM_LOAD( "galx.u",       0x0000, 0x0800, 0x79e4007d )
  2217.     ROM_LOAD( "galx.v",       0x0800, 0x0800, 0xbc16064e )
  2218.     ROM_LOAD( "galx.w",       0x1000, 0x0800, 0x72d2d3ee )
  2219.     ROM_LOAD( "galx.y",       0x1800, 0x0800, 0xafe397f3 )
  2220.     ROM_LOAD( "galx.z",       0x2000, 0x0800, 0x778c0d3c )
  2221.  
  2222.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2223.     ROM_LOAD( "galx.1h",      0x0000, 0x0800, 0xe8810654 )
  2224.     ROM_LOAD( "galx.1k",      0x0800, 0x0800, 0xcbe84a76 )
  2225.  
  2226.     ROM_REGION( 0x0020, REGION_PROMS )
  2227.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2228. ROM_END
  2229.  
  2230. ROM_START( galap1 )
  2231.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2232.     ROM_LOAD( "superg.u",     0x0000, 0x0800, 0xe8f3aa67 )
  2233.     ROM_LOAD( "superg.v",     0x0800, 0x0800, 0xf58283e3 )
  2234.     ROM_LOAD( "cp3",          0x1000, 0x0800, 0x4c7031c0 )
  2235.     ROM_LOAD( "galx_1_4.rom", 0x1800, 0x0800, 0xe71e1d9e )
  2236.     ROM_LOAD( "galx_1_5.rom", 0x2000, 0x0800, 0x6e65a3b2 )
  2237.  
  2238.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2239.     ROM_LOAD( "galmidw.1j",   0x0000, 0x0800, 0x84decf98 )
  2240.     ROM_LOAD( "galmidw.1k",   0x0800, 0x0800, 0xc31ada9e )
  2241.  
  2242.     ROM_REGION( 0x0020, REGION_PROMS )
  2243.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2244. ROM_END
  2245.  
  2246. ROM_START( galap4 )
  2247.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2248.     ROM_LOAD( "galnamco.u",   0x0000, 0x0800, 0xacfde501 )
  2249.     ROM_LOAD( "galnamco.v",   0x0800, 0x0800, 0x65cf3c77 )
  2250.     ROM_LOAD( "galnamco.w",   0x1000, 0x0800, 0x9eef9ae6 )
  2251.     ROM_LOAD( "galnamco.y",   0x1800, 0x0800, 0x56a5ddd1 )
  2252.     ROM_LOAD( "galnamco.z",   0x2000, 0x0800, 0xf4bc7262 )
  2253.  
  2254.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2255.     ROM_LOAD( "galx_4c1.rom", 0x0000, 0x0800, 0xd5e88ab4 )
  2256.     ROM_LOAD( "galx_4c2.rom", 0x0800, 0x0800, 0xa57b83e4 )
  2257.  
  2258.     ROM_REGION( 0x0020, REGION_PROMS )
  2259.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2260. ROM_END
  2261.  
  2262. ROM_START( galturbo )
  2263.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2264.     ROM_LOAD( "superg.u",     0x0000, 0x0800, 0xe8f3aa67 )
  2265.     ROM_LOAD( "galx.v",       0x0800, 0x0800, 0xbc16064e )
  2266.     ROM_LOAD( "superg.w",     0x1000, 0x0800, 0xddeabdae )
  2267.     ROM_LOAD( "galturbo.y",   0x1800, 0x0800, 0xa44f450f )
  2268.     ROM_LOAD( "galturbo.z",   0x2000, 0x0800, 0x3247f3d4 )
  2269.  
  2270.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2271.     ROM_LOAD( "galturbo.1h",  0x0000, 0x0800, 0xa713fd1a )
  2272.     ROM_LOAD( "galturbo.1k",  0x0800, 0x0800, 0x28511790 )
  2273.  
  2274.     ROM_REGION( 0x0020, REGION_PROMS )
  2275.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2276. ROM_END
  2277.  
  2278. ROM_START( swarm )
  2279.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2280.     ROM_LOAD( "swarm1.bin",    0x0000, 0x0800, 0x21eba3d0 )
  2281.     ROM_LOAD( "swarm2.bin",    0x0800, 0x0800, 0xf3a436cd )
  2282.     ROM_LOAD( "swarm3.bin",    0x1000, 0x0800, 0x2915e38b )
  2283.     ROM_LOAD( "swarm4.bin",    0x1800, 0x0800, 0x8bbbf486 )
  2284.     ROM_LOAD( "swarm5.bin",    0x2000, 0x0800, 0xf1b1987e )
  2285.  
  2286.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2287.     ROM_LOAD( "swarma.bin",    0x0000, 0x0800, 0xef8657bb )
  2288.     ROM_LOAD( "swarmb.bin",    0x0800, 0x0800, 0x60c4bd31 )
  2289.  
  2290.     ROM_REGION( 0x0020, REGION_PROMS )
  2291.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2292. ROM_END
  2293.  
  2294. ROM_START( zerotime )
  2295.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2296.     ROM_LOAD( "zt-p01c.016",  0x0000, 0x0800, 0x90a2bc61 )
  2297.     ROM_LOAD( "zt-2.016",     0x0800, 0x0800, 0xa433067e )
  2298.     ROM_LOAD( "zt-3.016",     0x1000, 0x0800, 0xaaf038d4 )
  2299.     ROM_LOAD( "zt-4.016",     0x1800, 0x0800, 0x786d690a )
  2300.     ROM_LOAD( "zt-5.016",     0x2000, 0x0800, 0xaf9260d7 )
  2301.  
  2302.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2303.     ROM_LOAD( "ztc-2.016",    0x0000, 0x0800, 0x1b13ca05 )
  2304.     ROM_LOAD( "ztc-1.016",    0x0800, 0x0800, 0x5cd7df03 )
  2305.  
  2306.     ROM_REGION( 0x0020, REGION_PROMS )
  2307.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2308. ROM_END
  2309.  
  2310. ROM_START( pisces )
  2311.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2312.     ROM_LOAD( "pisces.a1",    0x0000, 0x0800, 0x856b8e1f )
  2313.     ROM_LOAD( "pisces.a2",    0x0800, 0x0800, 0x055f9762 )
  2314.     ROM_LOAD( "pisces.b2",    0x1000, 0x0800, 0x5540f2e4 )
  2315.     ROM_LOAD( "pisces.c1",    0x1800, 0x0800, 0x44aaf525 )
  2316.     ROM_LOAD( "pisces.d1",    0x2000, 0x0800, 0xfade512b )
  2317.     ROM_LOAD( "pisces.e2",    0x2800, 0x0800, 0x5ab2822f )
  2318.  
  2319.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2320.     ROM_LOAD( "pisces.1j",    0x0000, 0x1000, 0x2dba9e0e )
  2321.     ROM_LOAD( "pisces.1k",    0x1000, 0x1000, 0xcdc5aa26 )
  2322.  
  2323.     ROM_REGION( 0x0020, REGION_PROMS )
  2324.     ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, 0x24652bc4 ) /* very close to Galaxian */
  2325. ROM_END
  2326.  
  2327. ROM_START( uniwars )
  2328.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2329.     ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, 0xd975af10 )
  2330.     ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, 0xb2ed14c3 )
  2331.     ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, 0x945f4160 )
  2332.     ROM_LOAD( "m07_4a.bin",   0x1800, 0x0800, 0xddc80bc5 )
  2333.     ROM_LOAD( "d08p_5a.bin",  0x2000, 0x0800, 0x62354351 )
  2334.     ROM_LOAD( "gg6",          0x2800, 0x0800, 0x270a3f4d )
  2335.     ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, 0xc9245346 )
  2336.     ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, 0x797d45c7 )
  2337.  
  2338.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2339.     ROM_LOAD( "egg10",        0x0000, 0x0800, 0x012941e0 )
  2340.     ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, 0xc26132af )
  2341.     ROM_LOAD( "egg9",         0x1000, 0x0800, 0xfc8b58fd )
  2342.     ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, 0xdcc2b33b )
  2343.  
  2344.     ROM_REGION( 0x0020, REGION_PROMS )
  2345.     ROM_LOAD( "uniwars.clr",  0x0000, 0x0020, 0x25c79518 )
  2346. ROM_END
  2347.  
  2348. ROM_START( gteikoku )
  2349.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2350.     ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, 0xd975af10 )
  2351.     ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, 0xb2ed14c3 )
  2352.     ROM_LOAD( "k07_3a.bin",   0x1000, 0x0800, 0x945f4160 )
  2353.     ROM_LOAD( "m07_4a.bin",   0x1800, 0x0800, 0xddc80bc5 )
  2354.     ROM_LOAD( "d08p_5a.bin",  0x2000, 0x0800, 0x62354351 )
  2355.     ROM_LOAD( "e08p_6a.bin",  0x2800, 0x0800, 0xd915a389 )
  2356.     ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, 0xc9245346 )
  2357.     ROM_LOAD( "n08p_8a.bin",  0x3800, 0x0800, 0x797d45c7 )
  2358.  
  2359.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2360.     ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, 0x8313c959 )
  2361.     ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, 0xc26132af )
  2362.     ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, 0xc9d4537e )
  2363.     ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, 0xdcc2b33b )
  2364.  
  2365.     ROM_REGION( 0x0020, REGION_PROMS )
  2366.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2367. ROM_END
  2368.  
  2369. ROM_START( spacbatt )
  2370.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2371.     ROM_LOAD( "f07_1a.bin",   0x0000, 0x0800, 0xd975af10 )
  2372.     ROM_LOAD( "h07_2a.bin",   0x0800, 0x0800, 0xb2ed14c3 )
  2373.     ROM_LOAD( "sb.3",         0x1000, 0x0800, 0xc25ce4c1 )
  2374.     ROM_LOAD( "sb.4",         0x1800, 0x0800, 0x8229835c )
  2375.     ROM_LOAD( "sb.5",         0x2000, 0x0800, 0xf51ef930 )
  2376.     ROM_LOAD( "e08p_6a.bin",  0x2800, 0x0800, 0xd915a389 )
  2377.     ROM_LOAD( "m08p_7a.bin",  0x3000, 0x0800, 0xc9245346 )
  2378.     ROM_LOAD( "sb.8",         0x3800, 0x0800, 0xe59ff1ae )
  2379.  
  2380.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2381.     ROM_LOAD( "h01_1.bin",    0x0000, 0x0800, 0x8313c959 )
  2382.     ROM_LOAD( "h01_2.bin",    0x0800, 0x0800, 0xc26132af )
  2383.     ROM_LOAD( "k01_1.bin",    0x1000, 0x0800, 0xc9d4537e )
  2384.     ROM_LOAD( "k01_2.bin",    0x1800, 0x0800, 0xdcc2b33b )
  2385.  
  2386.     ROM_REGION( 0x0020, REGION_PROMS )
  2387.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2388. ROM_END
  2389.  
  2390. ROM_START( warofbug )
  2391.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2392.     ROM_LOAD( "warofbug.u",   0x0000, 0x0800, 0xb8dfb7e3 )
  2393.     ROM_LOAD( "warofbug.v",   0x0800, 0x0800, 0xfd8854e0 )
  2394.     ROM_LOAD( "warofbug.w",   0x1000, 0x0800, 0x4495aa14 )
  2395.     ROM_LOAD( "warofbug.y",   0x1800, 0x0800, 0xc14a541f )
  2396.     ROM_LOAD( "warofbug.z",   0x2000, 0x0800, 0xc167fe55 )
  2397.  
  2398.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2399.     ROM_LOAD( "warofbug.1k",  0x0000, 0x0800, 0x8100fa85 )
  2400.     ROM_LOAD( "warofbug.1j",  0x0800, 0x0800, 0xd1220ae9 )
  2401.  
  2402.     ROM_REGION( 0x0020, REGION_PROMS )
  2403.     ROM_LOAD( "warofbug.clr", 0x0000, 0x0020, 0x8688e64b )
  2404. ROM_END
  2405.  
  2406. ROM_START( redufo )
  2407.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2408.     ROM_LOAD( "ru1a",         0x0000, 0x0800, 0x5a8e4f37 )
  2409.     ROM_LOAD( "ru2a",         0x0800, 0x0800, 0xc624f52d )
  2410.     ROM_LOAD( "ru3a",         0x1000, 0x0800, 0xe1030d1c )
  2411.     ROM_LOAD( "ru4a",         0x1800, 0x0800, 0x7692069e )
  2412.     ROM_LOAD( "ru5a",         0x2000, 0x0800, 0xcb648ff3 )
  2413.     ROM_LOAD( "ru6a",         0x2800, 0x0800, 0xe1a9f58e )
  2414.  
  2415.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2416.     ROM_LOAD( "ruhja",        0x0000, 0x0800, 0x8a422b0d )
  2417.     ROM_LOAD( "rukla",        0x0800, 0x0800, 0x1eb84cb1 )
  2418.  
  2419.     ROM_REGION( 0x0020, REGION_PROMS )
  2420.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2421. ROM_END
  2422.  
  2423. ROM_START( pacmanbl )
  2424.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2425.     ROM_LOAD( "blpac1b",      0x0000, 0x0800, 0x6718df42 )
  2426.     ROM_LOAD( "blpac2b",      0x0800, 0x0800, 0x33be3648 )
  2427.     ROM_LOAD( "blpac3b",      0x1000, 0x0800, 0xf98c0ceb )
  2428.     ROM_LOAD( "blpac4b",      0x1800, 0x0800, 0xa9cd0082 )
  2429.     ROM_LOAD( "blpac5b",      0x2000, 0x0800, 0x6d475afc )
  2430.     ROM_LOAD( "blpac6b",      0x2800, 0x0800, 0xcbe863d3 )
  2431.     ROM_LOAD( "blpac7b",      0x3000, 0x0800, 0x7daef758 )
  2432.  
  2433.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2434.     ROM_LOAD( "blpac12b",     0x0000, 0x0800, 0xb2ed320b )
  2435.     ROM_LOAD( "blpac11b",     0x0800, 0x0800, 0xab88b2c4 )
  2436.     ROM_LOAD( "blpac10b",     0x1000, 0x0800, 0x44a45b72 )
  2437.     ROM_LOAD( "blpac9b",      0x1800, 0x0800, 0xfa84659f )
  2438.  
  2439.     ROM_REGION( 0x0020, REGION_PROMS )
  2440.     ROM_LOAD( "6331-1j.86",   0x0000, 0x0020, 0x24652bc4 ) /* same as pisces */
  2441. ROM_END
  2442.  
  2443. ROM_START( devilfsg )
  2444.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  2445.     ROM_LOAD( "dfish1.7f",    0x2000, 0x0800, 0x2ab19698 )
  2446.     ROM_CONTINUE(             0x0000, 0x0800 )
  2447.     ROM_LOAD( "dfish2.7h",    0x2800, 0x0800, 0x4e77f097 )
  2448.     ROM_CONTINUE(             0x0800, 0x0800 )
  2449.     ROM_LOAD( "dfish3.7k",    0x3000, 0x0800, 0x3f16a4c6 )
  2450.     ROM_CONTINUE(             0x1000, 0x0800 )
  2451.     ROM_LOAD( "dfish4.7m",    0x3800, 0x0800, 0x11fc7e59 )
  2452.     ROM_CONTINUE(             0x1800, 0x0800 )
  2453.  
  2454.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2455.     ROM_LOAD( "dfish5.1h",    0x1000, 0x0800, 0xace6e31f )
  2456.     ROM_CONTINUE(             0x0000, 0x0800 )
  2457.     ROM_LOAD( "dfish6.1k",    0x1800, 0x0800, 0xd7a6c4c4 )
  2458.     ROM_CONTINUE(             0x0800, 0x0800 )
  2459.  
  2460.     ROM_REGION( 0x0020, REGION_PROMS )
  2461.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  2462. ROM_END
  2463.  
  2464. ROM_START( zigzag )
  2465.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2466.     ROM_LOAD( "zz_d1.bin",    0x0000, 0x1000, 0x8cc08d81 )
  2467.     ROM_LOAD( "zz_d2.bin",    0x1000, 0x1000, 0x326d8d45 )
  2468.     ROM_LOAD( "zz_d4.bin",    0x2000, 0x1000, 0xa94ed92a )
  2469.     ROM_LOAD( "zz_d3.bin",    0x3000, 0x1000, 0xce5e7a00 )
  2470.  
  2471.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2472.     ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, 0x780c162a )
  2473.     ROM_CONTINUE(             0x1000, 0x0800 )
  2474.     ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, 0xf3cdfec5 )
  2475.     ROM_CONTINUE(             0x1800, 0x0800 )
  2476.  
  2477.     ROM_REGION( 0x0020, REGION_PROMS )
  2478.     ROM_LOAD( "zzbp_e9.bin",  0x0000, 0x0020, 0xaa486dd0 )
  2479. ROM_END
  2480.  
  2481. ROM_START( zigzag2 )
  2482.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2483.     ROM_LOAD( "z1",           0x0000, 0x1000, 0x4c28349a )
  2484.     ROM_LOAD( "zz_d2.bin",    0x1000, 0x1000, 0x326d8d45 )
  2485.     ROM_LOAD( "zz_d4.bin",    0x2000, 0x1000, 0xa94ed92a )
  2486.     ROM_LOAD( "zz_d3.bin",    0x3000, 0x1000, 0xce5e7a00 )
  2487.  
  2488.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2489.     ROM_LOAD( "zz_6_h1.bin",  0x0000, 0x0800, 0x780c162a )
  2490.     ROM_CONTINUE(             0x1000, 0x0800 )
  2491.     ROM_LOAD( "zz_5.bin",     0x0800, 0x0800, 0xf3cdfec5 )
  2492.     ROM_CONTINUE(             0x1800, 0x0800 )
  2493.  
  2494.     ROM_REGION( 0x0020, REGION_PROMS )
  2495.     ROM_LOAD( "zzbp_e9.bin",  0x0000, 0x0020, 0xaa486dd0 )
  2496. ROM_END
  2497.  
  2498. ROM_START( mooncrgx )
  2499.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2500.     ROM_LOAD( "1",            0x0000, 0x0800, 0x84cf420b )
  2501.     ROM_LOAD( "2",            0x0800, 0x0800, 0x4c2a61a1 )
  2502.     ROM_LOAD( "3",            0x1000, 0x0800, 0x1962523a )
  2503.     ROM_LOAD( "4",            0x1800, 0x0800, 0x75dca896 )
  2504.     ROM_LOAD( "5",            0x2000, 0x0800, 0x32483039 )
  2505.     ROM_LOAD( "6",            0x2800, 0x0800, 0x43f2ab89 )
  2506.     ROM_LOAD( "7",            0x3000, 0x0800, 0x1e9c168c )
  2507.     ROM_LOAD( "8",            0x3800, 0x0800, 0x5e09da94 )
  2508.  
  2509.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2510.     ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, 0x528da705 )
  2511.     ROM_LOAD( "12.chr",       0x0800, 0x0800, 0x5a4b17ea )
  2512.     ROM_LOAD( "9.chr",        0x1000, 0x0800, 0x70df525c )
  2513.     ROM_LOAD( "11.chr",       0x1800, 0x0800, 0xe0edccbd )
  2514.  
  2515.     ROM_REGION( 0x0020, REGION_PROMS )
  2516.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2517. ROM_END
  2518.  
  2519. ROM_START( scramblb )
  2520.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2521.     ROM_LOAD( "scramble.1k",  0x0000, 0x0800, 0x9e025c4a )
  2522.     ROM_LOAD( "scramble.2k",  0x0800, 0x0800, 0x306f783e )
  2523.     ROM_LOAD( "scramble.3k",  0x1000, 0x0800, 0x0500b701 )
  2524.     ROM_LOAD( "scramble.4k",  0x1800, 0x0800, 0xdd380a22 )
  2525.     ROM_LOAD( "scramble.5k",  0x2000, 0x0800, 0xdf0b9648 )
  2526.     ROM_LOAD( "scramble.1j",  0x2800, 0x0800, 0xb8c07b3c )
  2527.     ROM_LOAD( "scramble.2j",  0x3000, 0x0800, 0x88ac07a0 )
  2528.     ROM_LOAD( "scramble.3j",  0x3800, 0x0800, 0xc67d57ca )
  2529.  
  2530.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2531.     ROM_LOAD( "5f.k",         0x0000, 0x0800, 0x4708845b )
  2532.     ROM_LOAD( "5h.k",         0x0800, 0x0800, 0x11fd2887 )
  2533.  
  2534.     ROM_REGION( 0x0020, REGION_PROMS )
  2535.     ROM_LOAD( "82s123.6e",    0x0000, 0x0020, 0x4e3caeab )
  2536. ROM_END
  2537.  
  2538. ROM_START( jumpbug )
  2539.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2540.     ROM_LOAD( "jb1",          0x0000, 0x1000, 0x415aa1b7 )
  2541.     ROM_LOAD( "jb2",          0x1000, 0x1000, 0xb1c27510 )
  2542.     ROM_LOAD( "jb3",          0x2000, 0x1000, 0x97c24be2 )
  2543.     ROM_LOAD( "jb4",          0x3000, 0x1000, 0x66751d12 )
  2544.     ROM_LOAD( "jb5",          0x8000, 0x1000, 0xe2d66faf )
  2545.     ROM_LOAD( "jb6",          0x9000, 0x1000, 0x49e0bdfd )
  2546.     ROM_LOAD( "jb7",          0xa000, 0x0800, 0x83d71302 )
  2547.  
  2548.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2549.     ROM_LOAD( "jbl",          0x0000, 0x0800, 0x9a091b0a )
  2550.     ROM_LOAD( "jbm",          0x0800, 0x0800, 0x8a0fc082 )
  2551.     ROM_LOAD( "jbn",          0x1000, 0x0800, 0x155186e0 )
  2552.     ROM_LOAD( "jbi",          0x1800, 0x0800, 0x7749b111 )
  2553.     ROM_LOAD( "jbj",          0x2000, 0x0800, 0x06e8d7df )
  2554.     ROM_LOAD( "jbk",          0x2800, 0x0800, 0xb8dbddf3 )
  2555.  
  2556.     ROM_REGION( 0x0020, REGION_PROMS )
  2557.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2558. ROM_END
  2559.  
  2560. ROM_START( jumpbugb )
  2561.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2562.     ROM_LOAD( "jb1",          0x0000, 0x1000, 0x415aa1b7 )
  2563.     ROM_LOAD( "jb2",          0x1000, 0x1000, 0xb1c27510 )
  2564.     ROM_LOAD( "jb3b",         0x2000, 0x1000, 0xcb8b8a0f )
  2565.     ROM_LOAD( "jb4",          0x3000, 0x1000, 0x66751d12 )
  2566.     ROM_LOAD( "jb5b",         0x8000, 0x1000, 0x7553b5e2 )
  2567.     ROM_LOAD( "jb6b",         0x9000, 0x1000, 0x47be9843 )
  2568.     ROM_LOAD( "jb7b",         0xa000, 0x0800, 0x460aed61 )
  2569.  
  2570.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2571.     ROM_LOAD( "jbl",          0x0000, 0x0800, 0x9a091b0a )
  2572.     ROM_LOAD( "jbm",          0x0800, 0x0800, 0x8a0fc082 )
  2573.     ROM_LOAD( "jbn",          0x1000, 0x0800, 0x155186e0 )
  2574.     ROM_LOAD( "jbi",          0x1800, 0x0800, 0x7749b111 )
  2575.     ROM_LOAD( "jbj",          0x2000, 0x0800, 0x06e8d7df )
  2576.     ROM_LOAD( "jbk",          0x2800, 0x0800, 0xb8dbddf3 )
  2577.  
  2578.     ROM_REGION( 0x0020, REGION_PROMS )
  2579.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2580. ROM_END
  2581.  
  2582. ROM_START( levers )
  2583.     ROM_REGION( 0x10000, REGION_CPU1 )       /* 64k for code */
  2584.     ROM_LOAD( "g96059.a8",       0x0000, 0x1000, 0x9550627a )
  2585.     ROM_LOAD( "g96060.d8",       0x2000, 0x1000, 0x5ac64646 )
  2586.     ROM_LOAD( "g96061.e8",       0x3000, 0x1000, 0x9db8e520 )
  2587.     ROM_LOAD( "g96062.h8",       0x8000, 0x1000, 0x7c8e8b3a )
  2588.     ROM_LOAD( "g96063.j8",       0x9000, 0x1000, 0xfa61e793 )
  2589.     ROM_LOAD( "g96064.l8",       0xa000, 0x1000, 0xf797f389 )
  2590.  
  2591.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2592.     ROM_LOAD( "g95948.n1",       0x0000, 0x0800, 0xd8a0c692 )
  2593.                             /*0x0800- 0x0fff empty */
  2594.     ROM_LOAD( "g95949.s1",       0x1000, 0x0800, 0x3660a552 )
  2595.     ROM_LOAD( "g95946.j1",       0x1800, 0x0800, 0x73b61b2d )
  2596.                             /*0x2000- 0x27ff empty */
  2597.     ROM_LOAD( "g95947.m1",       0x2800, 0x0800, 0x72ff67e2 )
  2598.  
  2599.     ROM_REGION( 0x0020, REGION_PROMS )
  2600.     ROM_LOAD( "g960lev.clr",  0x0000, 0x0020, 0x01febbbe )
  2601. ROM_END
  2602.  
  2603. ROM_START( azurian )
  2604.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2605.     ROM_LOAD( "pgm.1",        0x0000, 0x1000, 0x17a0fca7 )
  2606.     ROM_LOAD( "pgm.2",        0x1000, 0x1000, 0x14659848 )
  2607.     ROM_LOAD( "pgm.3",        0x2000, 0x1000, 0x8f60fb97 )
  2608.  
  2609.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2610.     ROM_LOAD( "gfx.1",        0x0000, 0x0800, 0xf5afb803 )
  2611.     ROM_LOAD( "gfx.2",        0x0800, 0x0800, 0xae96e5d1 )
  2612.  
  2613.     ROM_REGION( 0x0020, REGION_PROMS )
  2614.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2615. ROM_END
  2616.  
  2617. ROM_START( orbitron )
  2618.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2619.     ROM_LOAD( "orbitron.3",   0x0600, 0x0200, 0x419f9c9b )
  2620.     ROM_CONTINUE(              0x0400, 0x0200)
  2621.     ROM_CONTINUE(              0x0200, 0x0200)
  2622.     ROM_CONTINUE(              0x0000, 0x0200)
  2623.     ROM_LOAD( "orbitron.4",   0x0e00, 0x0200, 0x44ad56ac )
  2624.     ROM_CONTINUE(              0x0c00, 0x0200)
  2625.     ROM_CONTINUE(              0x0a00, 0x0200)
  2626.     ROM_CONTINUE(              0x0800, 0x0200)
  2627.     ROM_LOAD( "orbitron.1",   0x1600, 0x0200, 0xda3f5168 )
  2628.     ROM_CONTINUE(              0x1400, 0x0200)
  2629.     ROM_CONTINUE(              0x1200, 0x0200)
  2630.     ROM_CONTINUE(              0x1000, 0x0200)
  2631.     ROM_LOAD( "orbitron.2",   0x1e00, 0x0200, 0xa3b813fc )
  2632.     ROM_CONTINUE(              0x1c00, 0x0200)
  2633.     ROM_CONTINUE(              0x1a00, 0x0200)
  2634.     ROM_CONTINUE(              0x1800, 0x0200)
  2635.     ROM_LOAD( "orbitron.5",   0x2000, 0x0800, 0x20cd8bb8 )
  2636.  
  2637.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2638.     ROM_LOAD( "orbitron.6",   0x0000, 0x0800, 0x2c91b83f )
  2639.     ROM_LOAD( "orbitron.7",   0x0800, 0x0800, 0x46f4cca4 )
  2640.  
  2641.     ROM_REGION( 0x0020, REGION_PROMS )
  2642.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2643. ROM_END
  2644.  
  2645. ROM_START( checkman )
  2646.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2647.     ROM_LOAD( "cm1",          0x0000, 0x0800, 0xe8cbdd28 )
  2648.     ROM_LOAD( "cm2",          0x0800, 0x0800, 0xb8432d4d )
  2649.     ROM_LOAD( "cm3",          0x1000, 0x0800, 0x15a97f61 )
  2650.     ROM_LOAD( "cm4",          0x1800, 0x0800, 0x8c12ecc0 )
  2651.     ROM_LOAD( "cm5",          0x2000, 0x0800, 0x2352cfd6 )
  2652.  
  2653.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2654.     ROM_LOAD( "cm11",         0x0000, 0x0800, 0x8d1bcca0 )
  2655.     ROM_RELOAD(                  0x0800, 0x0800 )
  2656.     ROM_LOAD( "cm9",          0x1000, 0x0800, 0x3cd5c751 )
  2657.     ROM_RELOAD(                  0x1800, 0x0800 )
  2658.  
  2659.     ROM_REGION( 0x0020, REGION_PROMS )
  2660.     ROM_LOAD( "checkman.clr", 0x0000, 0x0020, 0x57a45057 )
  2661.  
  2662.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  2663.     ROM_LOAD( "cm13",         0x0000, 0x0800, 0x0b09a3e8 )
  2664.     ROM_LOAD( "cm14",         0x0800, 0x0800, 0x47f043be )
  2665. ROM_END
  2666.  
  2667. ROM_START( checkmaj )
  2668.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2669.     ROM_LOAD( "cm_1.bin",     0x0000, 0x1000, 0x456a118f )
  2670.     ROM_LOAD( "cm_2.bin",     0x1000, 0x1000, 0x146b2c44 )
  2671.     ROM_LOAD( "cm_3.bin",     0x2000, 0x0800, 0x73e1c945 )
  2672.  
  2673.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2674.     ROM_LOAD( "cm_6.bin",     0x0000, 0x0800, 0x476a7cc3 )
  2675.     ROM_LOAD( "cm_5.bin",     0x0800, 0x0800, 0xb3df2b5f )
  2676.  
  2677.     ROM_REGION( 0x0020, REGION_PROMS )
  2678.     ROM_LOAD( "checkman.clr", 0x0000, 0x0020, 0x57a45057 )
  2679.  
  2680.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  2681.     ROM_LOAD( "cm_4.bin",     0x0000, 0x1000, 0x923cffa1 )
  2682. ROM_END
  2683.  
  2684. ROM_START( streakng )
  2685.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2686.     ROM_LOAD( "sk1",          0x0000, 0x1000, 0xc8866ccb )
  2687.     ROM_LOAD( "sk2",          0x1000, 0x1000, 0x7caea29b )
  2688.     ROM_LOAD( "sk3",          0x2000, 0x1000, 0x7b4bfa76 )
  2689.     ROM_LOAD( "sk4",          0x3000, 0x1000, 0x056fc921 )
  2690.  
  2691.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2692.     ROM_LOAD( "sk5",          0x0000, 0x1000, 0xd27f1e0c )
  2693.     ROM_LOAD( "sk6",          0x1000, 0x1000, 0xa7089588 )
  2694.  
  2695.     ROM_REGION( 0x0020, REGION_PROMS )
  2696.     ROM_LOAD( "sk.bpr",       0x0000, 0x0020, 0xbce79607 )
  2697. ROM_END
  2698.  
  2699. ROM_START( blkhole )
  2700.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2701.     ROM_LOAD( "bh1",          0x0000, 0x0800, 0x64998819 )
  2702.     ROM_LOAD( "bh2",          0x0800, 0x0800, 0x26f26ce4 )
  2703.     ROM_LOAD( "bh3",          0x1000, 0x0800, 0x3418bc45 )
  2704.     ROM_LOAD( "bh4",          0x1800, 0x0800, 0x735ff481 )
  2705.     ROM_LOAD( "bh5",          0x2000, 0x0800, 0x3f657be9 )
  2706.     ROM_LOAD( "bh6",          0x2800, 0x0800, 0xa057ab35 )
  2707.  
  2708.     ROM_REGION( 0x1000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2709.     ROM_LOAD( "bh7",          0x0000, 0x0800, 0x975ba821 )
  2710.     ROM_LOAD( "bh8",          0x0800, 0x0800, 0x03d11020 )
  2711.  
  2712.     ROM_REGION( 0x0020, REGION_PROMS )
  2713.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2714. ROM_END
  2715.  
  2716. ROM_START( mooncrst )
  2717.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2718.     ROM_LOAD( "mc1",          0x0000, 0x0800, 0x7d954a7a )
  2719.     ROM_LOAD( "mc2",          0x0800, 0x0800, 0x44bb7cfa )
  2720.     ROM_LOAD( "mc3",          0x1000, 0x0800, 0x9c412104 )
  2721.     ROM_LOAD( "mc4",          0x1800, 0x0800, 0x7e9b1ab5 )
  2722.     ROM_LOAD( "mc5",          0x2000, 0x0800, 0x16c759af )
  2723.     ROM_LOAD( "mc6",          0x2800, 0x0800, 0x69bcafdb )
  2724.     ROM_LOAD( "mc7",          0x3000, 0x0800, 0xb50dbc46 )
  2725.     ROM_LOAD( "mc8",          0x3800, 0x0800, 0x18ca312b )
  2726.  
  2727.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2728.     ROM_LOAD( "mcs_b",        0x0000, 0x0800, 0xfb0f1f81 )
  2729.     ROM_LOAD( "mcs_d",        0x0800, 0x0800, 0x13932a15 )
  2730.     ROM_LOAD( "mcs_a",        0x1000, 0x0800, 0x631ebb5a )
  2731.     ROM_LOAD( "mcs_c",        0x1800, 0x0800, 0x24cfd145 )
  2732.  
  2733.     ROM_REGION( 0x0020, REGION_PROMS )
  2734.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2735. ROM_END
  2736.  
  2737. ROM_START( mooncrsg )
  2738.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2739.     ROM_LOAD( "epr194",       0x0000, 0x0800, 0x0e5582b1 )
  2740.     ROM_LOAD( "epr195",       0x0800, 0x0800, 0x12cb201b )
  2741.     ROM_LOAD( "epr196",       0x1000, 0x0800, 0x18255614 )
  2742.     ROM_LOAD( "epr197",       0x1800, 0x0800, 0x05ac1466 )
  2743.     ROM_LOAD( "epr198",       0x2000, 0x0800, 0xc28a2e8f )
  2744.     ROM_LOAD( "epr199",       0x2800, 0x0800, 0x5a4571de )
  2745.     ROM_LOAD( "epr200",       0x3000, 0x0800, 0xb7c85bf1 )
  2746.     ROM_LOAD( "epr201",       0x3800, 0x0800, 0x2caba07f )
  2747.  
  2748.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2749.     ROM_LOAD( "epr203",       0x0000, 0x0800, 0xbe26b561 )
  2750.     ROM_LOAD( "mcs_d",        0x0800, 0x0800, 0x13932a15 )
  2751.     ROM_LOAD( "epr202",       0x1000, 0x0800, 0x26c7e800 )
  2752.     ROM_LOAD( "mcs_c",        0x1800, 0x0800, 0x24cfd145 )
  2753.  
  2754.     ROM_REGION( 0x0020, REGION_PROMS )
  2755.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2756. ROM_END
  2757.  
  2758. ROM_START( smooncrs )
  2759.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2760.     ROM_LOAD( "927",          0x0000, 0x0800, 0x55c5b994 )
  2761.     ROM_LOAD( "928a",         0x0800, 0x0800, 0x77ae26d3 )
  2762.     ROM_LOAD( "929",          0x1000, 0x0800, 0x716eaa10 )
  2763.     ROM_LOAD( "930",          0x1800, 0x0800, 0xcea864f2 )
  2764.     ROM_LOAD( "931",          0x2000, 0x0800, 0x702c5f51 )
  2765.     ROM_LOAD( "932a",         0x2800, 0x0800, 0xe6a2039f )
  2766.     ROM_LOAD( "933",          0x3000, 0x0800, 0x73783cee )
  2767.     ROM_LOAD( "934",          0x3800, 0x0800, 0xc1a14aa2 )
  2768.  
  2769.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2770.     ROM_LOAD( "epr203",       0x0000, 0x0800, 0xbe26b561 )
  2771.     ROM_LOAD( "mcs_d",        0x0800, 0x0800, 0x13932a15 )
  2772.     ROM_LOAD( "epr202",       0x1000, 0x0800, 0x26c7e800 )
  2773.     ROM_LOAD( "mcs_c",        0x1800, 0x0800, 0x24cfd145 )
  2774.  
  2775.     ROM_REGION( 0x0020, REGION_PROMS )
  2776.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2777. ROM_END
  2778.  
  2779. ROM_START( mooncrsb )
  2780.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2781.     ROM_LOAD( "bepr194",      0x0000, 0x0800, 0x6a23ec6d )
  2782.     ROM_LOAD( "bepr195",      0x0800, 0x0800, 0xee262ff2 )
  2783.     ROM_LOAD( "f03.bin",      0x1000, 0x0800, 0x29a2b0ab )
  2784.     ROM_LOAD( "f04.bin",      0x1800, 0x0800, 0x4c6a5a6d )
  2785.     ROM_LOAD( "e5",           0x2000, 0x0800, 0x06d378a6 )
  2786.     ROM_LOAD( "bepr199",      0x2800, 0x0800, 0x6e84a927 )
  2787.     ROM_LOAD( "e7",           0x3000, 0x0800, 0xb45af1e8 )
  2788.     ROM_LOAD( "bepr201",      0x3800, 0x0800, 0x66da55d5 )
  2789.  
  2790.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2791.     ROM_LOAD( "epr203",       0x0000, 0x0800, 0xbe26b561 )
  2792.     ROM_LOAD( "mcs_d",        0x0800, 0x0800, 0x13932a15 )
  2793.     ROM_LOAD( "epr202",       0x1000, 0x0800, 0x26c7e800 )
  2794.     ROM_LOAD( "mcs_c",        0x1800, 0x0800, 0x24cfd145 )
  2795.  
  2796.     ROM_REGION( 0x0020, REGION_PROMS )
  2797.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2798. ROM_END
  2799.  
  2800. ROM_START( mooncrs2 )
  2801.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2802.     ROM_LOAD( "f8.bin",       0x0000, 0x0800, 0xd36003e5 )
  2803.     ROM_LOAD( "bepr195",      0x0800, 0x0800, 0xee262ff2 )
  2804.     ROM_LOAD( "f03.bin",      0x1000, 0x0800, 0x29a2b0ab )
  2805.     ROM_LOAD( "f04.bin",      0x1800, 0x0800, 0x4c6a5a6d )
  2806.     ROM_LOAD( "e5",           0x2000, 0x0800, 0x06d378a6 )
  2807.     ROM_LOAD( "bepr199",      0x2800, 0x0800, 0x6e84a927 )
  2808.     ROM_LOAD( "e7",           0x3000, 0x0800, 0xb45af1e8 )
  2809.     ROM_LOAD( "m7.bin",       0x3800, 0x0800, 0x957ee078 )
  2810.  
  2811.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2812.     ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, 0x528da705 )
  2813.     ROM_LOAD( "12.chr",       0x0800, 0x0200, 0x5a4b17ea )
  2814.     ROM_CONTINUE(             0x0c00, 0x0200 )    /* this version of the gfx ROMs has two */
  2815.     ROM_CONTINUE(             0x0a00, 0x0200 )    /* groups of 16 sprites swapped */
  2816.     ROM_CONTINUE(             0x0e00, 0x0200 )
  2817.     ROM_LOAD( "1k_1_11.bin",  0x1000, 0x0800, 0x4e79ff6b )
  2818.     ROM_LOAD( "11.chr",       0x1800, 0x0200, 0xe0edccbd )
  2819.     ROM_CONTINUE(             0x1c00, 0x0200 )
  2820.     ROM_CONTINUE(             0x1a00, 0x0200 )
  2821.     ROM_CONTINUE(             0x1e00, 0x0200 )
  2822.  
  2823.     ROM_REGION( 0x0020, REGION_PROMS )
  2824.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2825. ROM_END
  2826.  
  2827. ROM_START( fantazia )
  2828.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2829.     ROM_LOAD( "f01.bin",      0x0000, 0x0800, 0xd3e23863 )
  2830.     ROM_LOAD( "f02.bin",      0x0800, 0x0800, 0x63fa4149 )
  2831.     ROM_LOAD( "f03.bin",      0x1000, 0x0800, 0x29a2b0ab )
  2832.     ROM_LOAD( "f04.bin",      0x1800, 0x0800, 0x4c6a5a6d )
  2833.     ROM_LOAD( "f09.bin",      0x2000, 0x0800, 0x75fd5ca1 )
  2834.     ROM_LOAD( "f10.bin",      0x2800, 0x0800, 0xe4da2dd4 )
  2835.     ROM_LOAD( "f11.bin",      0x3000, 0x0800, 0x42869646 )
  2836.     ROM_LOAD( "f12.bin",      0x3800, 0x0800, 0xa48d7fb0 )
  2837.  
  2838.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2839.     ROM_LOAD( "1h_1_10.bin",  0x0000, 0x0800, 0x528da705 )
  2840.     ROM_LOAD( "mcs_d",        0x0800, 0x0800, 0x13932a15 )
  2841.     ROM_LOAD( "1k_1_11.bin",  0x1000, 0x0800, 0x4e79ff6b )
  2842.     ROM_LOAD( "mcs_c",        0x1800, 0x0800, 0x24cfd145 )
  2843.  
  2844.     ROM_REGION( 0x0020, REGION_PROMS )
  2845.     /* this PROM was bad (bit 3 always set). I tried to "fix" it to get more reasonable */
  2846.     /* colors, but it should not be considered correct. It's a bootleg anyway. */
  2847.     ROM_LOAD( "6l_prom.bin",  0x0000, 0x0020, BADCRC( 0xf5381d3e ) )
  2848. ROM_END
  2849.  
  2850. ROM_START( eagle )
  2851.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2852.     ROM_LOAD( "e1",           0x0000, 0x0800, 0x224c9526 )
  2853.     ROM_LOAD( "e2",           0x0800, 0x0800, 0xcc538ebd )
  2854.     ROM_LOAD( "f03.bin",      0x1000, 0x0800, 0x29a2b0ab )
  2855.     ROM_LOAD( "f04.bin",      0x1800, 0x0800, 0x4c6a5a6d )
  2856.     ROM_LOAD( "e5",           0x2000, 0x0800, 0x06d378a6 )
  2857.     ROM_LOAD( "e6",           0x2800, 0x0800, 0x0dea20d5 )
  2858.     ROM_LOAD( "e7",           0x3000, 0x0800, 0xb45af1e8 )
  2859.     ROM_LOAD( "e8",           0x3800, 0x0800, 0xc437a876 )
  2860.  
  2861.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2862.     ROM_LOAD( "e10",          0x0000, 0x0800, 0x40ce58bf )
  2863.     ROM_LOAD( "e12",          0x0800, 0x0200, 0x628fdeed )
  2864.     ROM_CONTINUE(             0x0c00, 0x0200 )    /* this version of the gfx ROMs has two */
  2865.     ROM_CONTINUE(             0x0a00, 0x0200 )    /* groups of 16 sprites swapped */
  2866.     ROM_CONTINUE(             0x0e00, 0x0200 )
  2867.     ROM_LOAD( "e9",           0x1000, 0x0800, 0xba664099 )
  2868.     ROM_LOAD( "e11",          0x1800, 0x0200, 0xee4ec5fd )
  2869.     ROM_CONTINUE(             0x1c00, 0x0200 )
  2870.     ROM_CONTINUE(             0x1a00, 0x0200 )
  2871.     ROM_CONTINUE(             0x1e00, 0x0200 )
  2872.  
  2873.     ROM_REGION( 0x0020, REGION_PROMS )
  2874.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2875. ROM_END
  2876.  
  2877. ROM_START( eagle2 )
  2878.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2879.     ROM_LOAD( "e1.7f",        0x0000, 0x0800, 0x45aab7a3 )
  2880.     ROM_LOAD( "e2",           0x0800, 0x0800, 0xcc538ebd )
  2881.     ROM_LOAD( "f03.bin",      0x1000, 0x0800, 0x29a2b0ab )
  2882.     ROM_LOAD( "f04.bin",      0x1800, 0x0800, 0x4c6a5a6d )
  2883.     ROM_LOAD( "e5",           0x2000, 0x0800, 0x06d378a6 )
  2884.     ROM_LOAD( "e6.6",         0x2800, 0x0800, 0x9f09f8c6 )
  2885.     ROM_LOAD( "e7",           0x3000, 0x0800, 0xb45af1e8 )
  2886.     ROM_LOAD( "e8",           0x3800, 0x0800, 0xc437a876 )
  2887.  
  2888.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2889.     ROM_LOAD( "e10.2",        0x0000, 0x0800, 0x25b38ebd )
  2890.     ROM_LOAD( "e12",          0x0800, 0x0200, 0x628fdeed )
  2891.     ROM_CONTINUE(             0x0c00, 0x0200 )    /* this version of the gfx ROMs has two */
  2892.     ROM_CONTINUE(             0x0a00, 0x0200 )    /* groups of 16 sprites swapped */
  2893.     ROM_CONTINUE(             0x0e00, 0x0200 )
  2894.     ROM_LOAD( "e9",           0x1000, 0x0800, 0xba664099 )
  2895.     ROM_LOAD( "e11",          0x1800, 0x0200, 0xee4ec5fd )
  2896.     ROM_CONTINUE(             0x1c00, 0x0200 )
  2897.     ROM_CONTINUE(             0x1a00, 0x0200 )
  2898.     ROM_CONTINUE(             0x1e00, 0x0200 )
  2899.  
  2900.     ROM_REGION( 0x0020, REGION_PROMS )
  2901.     ROM_LOAD( "l06_prom.bin", 0x0000, 0x0020, 0x6a0c7d87 )
  2902. ROM_END
  2903.  
  2904. ROM_START( moonqsr )
  2905.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 64k for code + 64k for decrypted opcodes */
  2906.     ROM_LOAD( "mq1",          0x0000, 0x0800, 0x132c13ec )
  2907.     ROM_LOAD( "mq2",          0x0800, 0x0800, 0xc8eb74f1 )
  2908.     ROM_LOAD( "mq3",          0x1000, 0x0800, 0x33965a89 )
  2909.     ROM_LOAD( "mq4",          0x1800, 0x0800, 0xa3861d17 )
  2910.     ROM_LOAD( "mq5",          0x2000, 0x0800, 0x8bcf9c67 )
  2911.     ROM_LOAD( "mq6",          0x2800, 0x0800, 0x5750cda9 )
  2912.     ROM_LOAD( "mq7",          0x3000, 0x0800, 0x78d7fe5b )
  2913.     ROM_LOAD( "mq8",          0x3800, 0x0800, 0x4919eed5 )
  2914.  
  2915.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2916.     ROM_LOAD( "mqb",          0x0000, 0x0800, 0xb55ec806 )
  2917.     ROM_LOAD( "mqd",          0x0800, 0x0800, 0x9e7d0e13 )
  2918.     ROM_LOAD( "mqa",          0x1000, 0x0800, 0x66eee0db )
  2919.     ROM_LOAD( "mqc",          0x1800, 0x0800, 0xa6db5b0d )
  2920.  
  2921.     ROM_REGION( 0x0020, REGION_PROMS )
  2922.     ROM_LOAD( "vid_e6.bin",   0x0000, 0x0020, 0x0b878b54 )
  2923. ROM_END
  2924.  
  2925. ROM_START( moonal2 )
  2926.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  2927.     ROM_LOAD( "ali1",         0x0000, 0x0400, 0x0dcecab4 )
  2928.     ROM_LOAD( "ali2",         0x0400, 0x0400, 0xc6ee75a7 )
  2929.     ROM_LOAD( "ali3",         0x0800, 0x0400, 0xcd1be7e9 )
  2930.     ROM_LOAD( "ali4",         0x0c00, 0x0400, 0x83b03f08 )
  2931.     ROM_LOAD( "ali5",         0x1000, 0x0400, 0x6f3cf61d )
  2932.     ROM_LOAD( "ali6",         0x1400, 0x0400, 0xe169d432 )
  2933.     ROM_LOAD( "ali7",         0x1800, 0x0400, 0x41f64b73 )
  2934.     ROM_LOAD( "ali8",         0x1c00, 0x0400, 0xf72ee876 )
  2935.     ROM_LOAD( "ali9",         0x2000, 0x0400, 0xb7fb763c )
  2936.     ROM_LOAD( "ali10",        0x2400, 0x0400, 0xb1059179 )
  2937.     ROM_LOAD( "ali11",        0x2800, 0x0400, 0x9e79a1c6 )
  2938.  
  2939.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2940.     ROM_LOAD( "ali13.1h",     0x0000, 0x0800, 0xa1287bf6 )
  2941.     ROM_RELOAD(                  0x0800, 0x0800 )
  2942.     ROM_LOAD( "ali12.1k",     0x1000, 0x0800, 0x528f1481 )
  2943.     ROM_RELOAD(                  0x1800, 0x0800 )
  2944.  
  2945.     ROM_REGION( 0x0020, REGION_PROMS )
  2946.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2947. ROM_END
  2948.  
  2949. ROM_START( moonal2b )
  2950.     ROM_REGION( 0x10000, REGION_CPU1 ) /* 64k for code */
  2951.     ROM_LOAD( "ali1",         0x0000, 0x0400, 0x0dcecab4 )
  2952.     ROM_LOAD( "ali2",         0x0400, 0x0400, 0xc6ee75a7 )
  2953.     ROM_LOAD( "md-2",         0x0800, 0x0800, 0x8318b187 )
  2954.     ROM_LOAD( "ali5",         0x1000, 0x0400, 0x6f3cf61d )
  2955.     ROM_LOAD( "ali6",         0x1400, 0x0400, 0xe169d432 )
  2956.     ROM_LOAD( "ali7",         0x1800, 0x0400, 0x41f64b73 )
  2957.     ROM_LOAD( "ali8",         0x1c00, 0x0400, 0xf72ee876 )
  2958.     ROM_LOAD( "ali9",         0x2000, 0x0400, 0xb7fb763c )
  2959.     ROM_LOAD( "ali10",        0x2400, 0x0400, 0xb1059179 )
  2960.     ROM_LOAD( "md-6",         0x2800, 0x0800, 0x9cc973e0 )
  2961.  
  2962.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2963.     ROM_LOAD( "ali13.1h",     0x0000, 0x0800, 0xa1287bf6 )
  2964.     ROM_RELOAD(                  0x0800, 0x0800 )
  2965.     ROM_LOAD( "ali12.1k",     0x1000, 0x0800, 0x528f1481 )
  2966.     ROM_RELOAD(                  0x1800, 0x0800 )
  2967.  
  2968.     ROM_REGION( 0x0020, REGION_PROMS )
  2969.     ROM_LOAD( "galaxian.clr", 0x0000, 0x0020, 0xc3ac9467 )
  2970. ROM_END
  2971.  
  2972. ROM_START( kingball )
  2973.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2974.     ROM_LOAD( "prg1.7f",      0x0000, 0x1000, 0x6cb49046 )
  2975.     ROM_LOAD( "prg2.7j",      0x1000, 0x1000, 0xc223b416 )
  2976.     ROM_LOAD( "prg3.7l",      0x2000, 0x0800, 0x453634c0 )
  2977.  
  2978.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  2979.     ROM_LOAD( "chg1.1h",      0x0000, 0x0800, 0x9cd550e7 )
  2980.     ROM_RELOAD(                  0x0800, 0x0800 )
  2981.     ROM_LOAD( "chg2.1k",      0x1000, 0x0800, 0xa206757d )
  2982.     ROM_RELOAD(                  0x1800, 0x0800 )
  2983.  
  2984.     ROM_REGION( 0x0020, REGION_PROMS )
  2985.     ROM_LOAD( "kb2-1",        0x0000, 0x0020, 0x15dd5b16 )
  2986.  
  2987.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  2988.     ROM_LOAD( "kbe1.ic4",     0x0000, 0x0800, 0x5be2c80a )
  2989.     ROM_LOAD( "kbe2.ic5",     0x0800, 0x0800, 0xbb59e965 )
  2990.     ROM_LOAD( "kbe3.ic6",     0x1000, 0x0800, 0x1c94dd31 )
  2991.     ROM_LOAD( "kbe2.ic7",     0x1800, 0x0800, 0xbb59e965 )
  2992. ROM_END
  2993.  
  2994. ROM_START( kingbalj )
  2995.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  2996.     ROM_LOAD( "prg1.7f",      0x0000, 0x1000, 0x6cb49046 )
  2997.     ROM_LOAD( "prg2.7j",      0x1000, 0x1000, 0xc223b416 )
  2998.     ROM_LOAD( "prg3.7l",      0x2000, 0x0800, 0x453634c0 )
  2999.  
  3000.     ROM_REGION( 0x2000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  3001.     ROM_LOAD( "chg1.1h",      0x0000, 0x0800, 0x9cd550e7 )
  3002.     ROM_RELOAD(                  0x0800, 0x0800 )
  3003.     ROM_LOAD( "chg2.1k",      0x1000, 0x0800, 0xa206757d )
  3004.     ROM_RELOAD(                  0x1800, 0x0800 )
  3005.  
  3006.     ROM_REGION( 0x0020, REGION_PROMS )
  3007.     ROM_LOAD( "kb2-1",        0x0000, 0x0020, 0x15dd5b16 )
  3008.  
  3009.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound code */
  3010.     ROM_LOAD( "kbj1.ic4",     0x0000, 0x0800, 0xba16beb7 )
  3011.     ROM_LOAD( "kbj2.ic5",     0x0800, 0x0800, 0x56686a63 )
  3012.     ROM_LOAD( "kbj3.ic6",     0x1000, 0x0800, 0xfbc570a5 )
  3013.     ROM_LOAD( "kbj2.ic7",     0x1800, 0x0800, 0x56686a63 )
  3014. ROM_END
  3015.  
  3016.  
  3017.  
  3018. static void init_pisces(void)
  3019. {
  3020.     install_mem_write_handler(0, 0x6002, 0x6002, pisces_gfxbank_w);
  3021. }
  3022.  
  3023. static void init_checkmaj(void)
  3024. {
  3025.     /* for the title screen */
  3026.     install_mem_read_handler(0, 0x3800, 0x3800, checkmaj_protection_r);
  3027. }
  3028.  
  3029. static unsigned char decode(int data,int addr)
  3030. {
  3031.     int res;
  3032.  
  3033.     res = data;
  3034.     if (data & 0x02) res ^= 0x40;
  3035.     if (data & 0x20) res ^= 0x04;
  3036.     if ((addr & 1) == 0)
  3037.         res = (res & 0xbb) | ((res & 0x40) >> 4) | ((res & 0x04) << 4);
  3038.     return res;
  3039. }
  3040.  
  3041. static void init_mooncrst(void)
  3042. {
  3043.     int A;
  3044.     unsigned char *rom = memory_region(REGION_CPU1);
  3045.  
  3046.  
  3047.     for (A = 0;A < 0x10000;A++)
  3048.         rom[A] = decode(rom[A],A);
  3049. }
  3050.  
  3051. static void init_moonal2(void)
  3052. {
  3053.     install_mem_write_handler(0, 0xa000, 0xa002, MWA_NOP);
  3054. }
  3055.  
  3056. static void init_moonqsr(void)
  3057. {
  3058.     int A;
  3059.     unsigned char *rom = memory_region(REGION_CPU1);
  3060.     int diff = memory_region_length(REGION_CPU1) / 2;
  3061.  
  3062.  
  3063.     memory_set_opcode_base(0,rom+diff);
  3064.  
  3065.     for (A = 0;A < 0x10000;A++)
  3066.         rom[A + diff] = decode(rom[A],A);
  3067. }
  3068.  
  3069. static void init_checkman(void)
  3070. {
  3071. /*
  3072.                      Encryption Table
  3073.                      ----------------
  3074. +---+---+---+------+------+------+------+------+------+------+------+
  3075. |A2 |A1 |A0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0    |
  3076. +---+---+---+------+------+------+------+------+------+------+------+
  3077. | 0 | 0 | 0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0^^D6|
  3078. | 0 | 0 | 1 |D7    |D6    |D5    |D4    |D3    |D2    |D1^^D5|D0    |
  3079. | 0 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D4|D1^^D6|D0    |
  3080. | 0 | 1 | 1 |D7    |D6    |D5    |D4^^D2|D3    |D2    |D1    |D0^^D5|
  3081. | 1 | 0 | 0 |D7    |D6^^D4|D5^^D1|D4    |D3    |D2    |D1    |D0    |
  3082. | 1 | 0 | 1 |D7    |D6^^D0|D5^^D2|D4    |D3    |D2    |D1    |D0    |
  3083. | 1 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D0|D1    |D0    |
  3084. | 1 | 1 | 1 |D7    |D6    |D5    |D4^^D1|D3    |D2    |D1    |D0    |
  3085. +---+---+---+------+------+------+------+------+------+------+------+
  3086.  
  3087. For example if A2=1, A1=1 and A0=0 then D2 to the CPU would be an XOR of
  3088. D2 and D0 from the ROM's. Note that D7 and D3 are not encrypted.
  3089.  
  3090. Encryption PAL 16L8 on cardridge
  3091.          +--- ---+
  3092.     OE --|   U   |-- VCC
  3093.  ROMD0 --|       |-- D0
  3094.  ROMD1 --|       |-- D1
  3095.  ROMD2 --|VER 5.2|-- D2
  3096.     A0 --|       |-- NOT USED
  3097.     A1 --|       |-- A2
  3098.  ROMD4 --|       |-- D4
  3099.  ROMD5 --|       |-- D5
  3100.  ROMD6 --|       |-- D6
  3101.    GND --|       |-- M1 (NOT USED)
  3102.          +-------+
  3103. Pin layout is such that links can replace the PAL if encryption is not used.
  3104.  
  3105. */
  3106.     int A;
  3107.     int data_xor=0;
  3108.     unsigned char *rom = memory_region(REGION_CPU1);
  3109.  
  3110.  
  3111.     for (A = 0;A < 0x2800;A++)
  3112.     {
  3113.         switch (A & 0x07)
  3114.         {
  3115.             case 0: data_xor =  (rom[A] & 0x40) >> 6; break;
  3116.             case 1: data_xor =  (rom[A] & 0x20) >> 4; break;
  3117.             case 2: data_xor = ((rom[A] & 0x10) >> 2) | ((rom[A] & 0x40) >> 5); break;
  3118.             case 3: data_xor = ((rom[A] & 0x04) << 2) | ((rom[A] & 0x20) >> 5); break;
  3119.             case 4: data_xor = ((rom[A] & 0x10) << 2) | ((rom[A] & 0x02) << 4); break;
  3120.             case 5: data_xor = ((rom[A] & 0x01) << 6) | ((rom[A] & 0x04) << 3); break;
  3121.             case 6: data_xor =  (rom[A] & 0x01) << 2; break;
  3122.             case 7: data_xor =  (rom[A] & 0x02) << 3; break;
  3123.         }
  3124.         rom[A] ^= data_xor;
  3125.     }
  3126. }
  3127.  
  3128.  
  3129. GAME( 1979, galaxian, 0,        galaxian, galaxian, 0,        ROT90,  "Namco", "Galaxian (Namco)" )
  3130. GAME( 1979, galmidw,  galaxian, galaxian, galaxian, 0,        ROT90,  "[Namco] (Midway license)", "Galaxian (Midway)" )
  3131. GAME( 1979, superg,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Super Galaxians" )
  3132. GAME( 1979, galaxb,   galaxian, galaxian, superg,   0,        ROT90,  "bootleg", "Galaxian (bootleg)" )
  3133. GAME( 1979, galapx,   galaxian, galapx,   superg,   0,        ROT90,  "hack", "Galaxian Part X" )
  3134. GAME( 1979, galap1,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Space Invaders Galactica" )
  3135. GAME( 1979, galap4,   galaxian, galaxian, superg,   0,        ROT90,  "hack", "Galaxian Part 4" )
  3136. GAME( 1979, galturbo, galaxian, galaxian, superg,   0,        ROT90,  "hack", "Galaxian Turbo" )
  3137. GAME( 1979, swarm,    galaxian, galaxian, swarm,    0,        ROT90,  "hack", "Swarm" )
  3138. GAME( 1979, zerotime, galaxian, galaxian, zerotime, 0,        ROT90,  "Petaco S.A.", "Zero Time" )
  3139. GAME( ????, pisces,   0,        pisces,   pisces,   pisces,   ROT90,  "<unknown>", "Pisces" )
  3140. GAME( 1980, uniwars,  0,        pisces,   superg,   pisces,   ROT90,  "Irem", "UniWar S" )
  3141. GAME( 1980, gteikoku, uniwars,  pisces,   superg,   pisces,   ROT90,  "Irem", "Gingateikoku No Gyakushu" )
  3142. GAME( 1980, spacbatt, uniwars,  pisces,   superg,   pisces,   ROT90,  "bootleg", "Space Battle" )
  3143. GAME( 1981, warofbug, 0,        warofbug, warofbug, 0,        ROT90,  "Armenia", "War of the Bugs" )
  3144. GAME( ????, redufo,   0,        warofbug, redufo,   0,        ROT90,  "Hara Industries??", "Defend the Terra Attack on the Red UFO" )
  3145. GAME( 1981, pacmanbl, pacman,   pacmanbl, pacmanbl, 0,        ROT270, "bootleg", "Pac-Man (bootleg on Galaxian hardware)" )
  3146. GAME( 1984, devilfsg, devilfsh, devilfsg, devilfsg, 0,        ROT270, "Vision / Artic", "Devil Fish (Galaxian hardware, bootleg?)" )
  3147. GAME( 1982, zigzag,   0,        zigzag,   zigzag,   0,        ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 1)" )
  3148. GAME( 1982, zigzag2,  zigzag,   zigzag,   zigzag,   0,        ROT90,  "LAX", "Zig Zag (Galaxian hardware, set 2)" )
  3149. GAME( 1981, scramblb, scramble, scramblb, scramblb, 0,        ROT90,  "bootleg", "Scramble (bootleg on Galaxian hardware)" )
  3150. GAME( 1981, jumpbug,  0,        jumpbug,  jumpbug,  0,        ROT90,  "Rock-ola", "Jump Bug" )
  3151. GAME( 1981, jumpbugb, jumpbug,  jumpbug,  jumpbug,  0,        ROT90,  "bootleg", "Jump Bug (bootleg)" )
  3152. GAME( 1983, levers,   0,        jumpbug,  levers,   0,        ROT90,  "Rock-ola", "Levers" )
  3153. GAME( 1982, azurian,  0,        azurian,  azurian,  0,        ROT90,  "Rait Electronics Ltd", "Azurian Attack" )
  3154. GAME( ????, orbitron, 0,        azurian,  orbitron, 0,        ROT270, "Signatron USA", "Orbitron" )
  3155. GAME( 1982, checkman, 0,        checkman, checkman, checkman, ROT90,  "Zilec-Zenitone", "Checkman" )
  3156. GAME( 1982, checkmaj, checkman, checkmaj, checkmaj, checkmaj, ROT90,  "Jaleco", "Checkman (Japan)" )
  3157. GAME( 1980, streakng, 0,        pacmanbl, streakng, 0,        ROT90,  "Shoei", "Streaking" )
  3158. GAME( ????, blkhole,  0,        galaxian, blkhole,  0,        ROT90,  "TDS", "Black Hole" )
  3159. GAME( 1980, mooncrst, 0,        mooncrst, mooncrst, mooncrst, ROT90,  "Nichibutsu", "Moon Cresta (Nichibutsu)" )
  3160. GAME( 1980, mooncrsg, mooncrst, mooncrst, mooncrst, 0,        ROT90,  "Gremlin", "Moon Cresta (Gremlin)" )
  3161. GAME( 1980?,smooncrs, mooncrst, mooncrst, mooncrst, 0,        ROT90,  "Gremlin", "Super Moon Cresta" )
  3162. GAME( 1980, mooncrsb, mooncrst, mooncrst, mooncrst, 0,        ROT90,  "bootleg", "Moon Cresta (bootleg set 1)" )
  3163. GAME( 1980, mooncrs2, mooncrst, mooncrst, mooncrst, 0,        ROT90,  "Nichibutsu", "Moon Cresta (bootleg set 2)" )
  3164. GAME( 1980, fantazia, mooncrst, mooncrst, mooncrst, 0,        ROT90,  "bootleg", "Fantazia" )
  3165. GAME( 1980, eagle,    mooncrst, mooncrst, eagle,    0,        ROT90,  "Centuri", "Eagle (set 1)" )
  3166. GAME( 1980, eagle2,   mooncrst, mooncrst, eagle2,   0,        ROT90,  "Centuri", "Eagle (set 2)" )
  3167. GAME( 1980, mooncrgx, mooncrst, mooncrgx, mooncrgx, 0,        ROT270, "bootleg", "Moon Cresta (bootleg on Galaxian hardware)" )
  3168. GAME( 1980, moonqsr,  0,        moonqsr,  moonqsr,  moonqsr,  ROT90,  "Nichibutsu", "Moon Quasar" )
  3169. GAME( 1980, moonal2,  0,        mooncrst, moonal2,  moonal2,  ROT90,  "Nichibutsu", "Moon Alien Part 2" )
  3170. GAME( 1980, moonal2b, moonal2,  mooncrst, moonal2,  moonal2,  ROT90,  "Nichibutsu", "Moon Alien Part 2 (older version)" )
  3171. GAME( 1980, kingball, 0,        kingball, kingball, 0,        ROT90,  "Namco", "King & Balloon (US)" )
  3172. GAME( 1980, kingbalj, kingball, kingball, kingball, 0,        ROT90,  "Namco", "King & Balloon (Japan)" )
  3173.